...
|
...
|
@@ -12,10 +12,6 @@ export default { |
|
|
const {proxy} = Vue.getCurrentInstance();
|
|
|
// Start LSQ 2022/1/5
|
|
|
let height = Vue.ref(window.innerHeight - 10);
|
|
|
// 挂载完
|
|
|
Vue.onMounted(() => {
|
|
|
|
|
|
})
|
|
|
//配置项标签数据
|
|
|
let tagData=Vue.ref([{
|
|
|
name:'配置1',
|
...
|
...
|
@@ -30,28 +26,24 @@ export default { |
|
|
//表格字段
|
|
|
let columns=Vue.ref([
|
|
|
{
|
|
|
prop: 'busTypeName',
|
|
|
label: '业务系统',
|
|
|
prop: 'classify',
|
|
|
label: '分类',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
width:'300'
|
|
|
},
|
|
|
{
|
|
|
prop: 'resName',
|
|
|
label: '资源名称',
|
|
|
prop: 'key',
|
|
|
label: '缓存key',
|
|
|
sortable: true,
|
|
|
align: 'center',
|
|
|
},
|
|
|
])
|
|
|
let page=Vue.ref(1);
|
|
|
let currentPage=Vue.ref(1);
|
|
|
let pageSize=Vue.ref(10);
|
|
|
let keyWords=Vue.ref();
|
|
|
let keyword=Vue.ref();
|
|
|
let count=Vue.ref(0);
|
|
|
let tableDataList=Vue.ref([{
|
|
|
busTypeName:'电子税务局',
|
|
|
id:'111',
|
|
|
resName:'缓存',
|
|
|
val:'25698458'
|
|
|
}]);
|
|
|
let tableDataList=Vue.ref([]);
|
|
|
let checkedId = Vue.ref(0);
|
|
|
let titleName=Vue.ref('查看数据')
|
|
|
let cacheVisible=Vue.ref(false);
|
...
|
...
|
@@ -61,19 +53,71 @@ export default { |
|
|
|
|
|
//点击标签进行搜索
|
|
|
const changeTag = (status) => {
|
|
|
console.log("aa",status)
|
|
|
checkedId.value = status;
|
|
|
keyword.value=status;
|
|
|
getDataList();
|
|
|
}
|
|
|
//操作按钮 查看
|
|
|
const handleView=(row,index)=>{
|
|
|
viewData.value=row.val;
|
|
|
cacheVisible.value=true;
|
|
|
viewDetail(row.key);
|
|
|
|
|
|
}
|
|
|
//获取配置项列表
|
|
|
let getConf=()=>{
|
|
|
let params={
|
|
|
ddicCategory:'INIT_REDIS_CACHE'
|
|
|
// ddicName:'缓存展示'
|
|
|
|
|
|
}
|
|
|
//api-web/manage/ddic/page
|
|
|
//api-web/ContrastAnalysis/selectTogetherRate
|
|
|
proxy.$http.get(`/api-web/manage/ddic/page`, params, function (res) {
|
|
|
if (res && res.data) {
|
|
|
tagData.value=res.data;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//查看详情
|
|
|
let viewDetail=(val)=>{
|
|
|
let params={
|
|
|
key:val
|
|
|
}
|
|
|
|
|
|
proxy.$http.get(`/api-web/redis/cache/key`, params, function (res) {
|
|
|
if (res) {
|
|
|
viewData.value =prettyFormat([res]) ;
|
|
|
cacheVisible.value=true;
|
|
|
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
let prettyFormat=(code)=> {
|
|
|
try {
|
|
|
for (const key in code) {
|
|
|
console.log("code",key,typeof code[key])
|
|
|
if (typeof code[key] === 'function') {
|
|
|
let str = code[key];
|
|
|
str = str.toString();
|
|
|
code[key] = str.replace(/\n/g, '<br/>');
|
|
|
}
|
|
|
}
|
|
|
// 设置缩进为2个空格
|
|
|
let str = JSON.stringify(code, null, 2);
|
|
|
str = str
|
|
|
.replace(/&/g, '&')
|
|
|
.replace(/</g, '<')
|
|
|
.replace(/>/g, '>');
|
|
|
// str = str.replace(/\n/g, '/r')
|
|
|
return str;
|
|
|
} catch (e) {
|
|
|
console.error('异常信息:' + e);
|
|
|
return '';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//重新加载表格数据
|
|
|
let loadTableDataList = ({page, limit}) => {
|
|
|
page.value=page;
|
|
|
currentPage.value=page;
|
|
|
pageSize.value=limit;
|
|
|
getDataList()
|
|
|
}
|
...
|
...
|
@@ -83,37 +127,46 @@ export default { |
|
|
}
|
|
|
//获取缓存数据
|
|
|
let getDataList=()=>{
|
|
|
let params={
|
|
|
page:page.value,
|
|
|
pageSize:pageSize.value,
|
|
|
keyWord:keyWords.value,
|
|
|
id:checkedId.value
|
|
|
}
|
|
|
/*proxy.$http.get(`/api-web/`, params, function (res) {
|
|
|
if (res && res.success) {
|
|
|
count.value = res.count;
|
|
|
tableDataList.value = res.data;
|
|
|
if(keyword.value){
|
|
|
let params={
|
|
|
page:currentPage.value,
|
|
|
pageSize:pageSize.value,
|
|
|
keyword:keyword.value,
|
|
|
}
|
|
|
});*/
|
|
|
proxy.$http.get(`/api-web/redis/cache`, params, function (res) {
|
|
|
if (res && res.data) {
|
|
|
count.value = res.count;
|
|
|
tableDataList.value = res.data;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
//关闭弹框回调函数
|
|
|
let closeDialog=()=>{
|
|
|
cacheVisible.value=false;
|
|
|
|
|
|
}
|
|
|
//关闭弹框
|
|
|
let cancelBtn=()=>{
|
|
|
cacheVisible.value=false;
|
|
|
}
|
|
|
// 挂载完
|
|
|
Vue.onMounted(() => {
|
|
|
getConf();
|
|
|
getDataList();
|
|
|
|
|
|
})
|
|
|
return {
|
|
|
num,
|
|
|
height,
|
|
|
columns,
|
|
|
tagData,
|
|
|
page,
|
|
|
currentPage,
|
|
|
count,
|
|
|
pageSize,
|
|
|
keyWords,
|
|
|
keyword,
|
|
|
tableDataList,
|
|
|
checkedId,
|
|
|
changeTag,
|
...
|
...
|
@@ -125,7 +178,10 @@ export default { |
|
|
titleName,
|
|
|
viewData,
|
|
|
closeDialog,
|
|
|
cancelBtn
|
|
|
cancelBtn,
|
|
|
viewDetail,
|
|
|
prettyFormat,
|
|
|
getConf
|
|
|
|
|
|
}
|
|
|
//End LSQ 2022/1/5
|
...
|
...
|
|