{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\redis\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\system\\redis\\index.vue","mtime":1732871026795},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport { getCache, getKeyDefineList, getKeyValueList, batch } from '@/api/system/redis'\r\nimport echarts from 'echarts'\r\nexport default {\r\n name: 'Redis',\r\n data() {\r\n return {\r\n // 统计命令信息\r\n commandstats: null,\r\n // 使用内存\r\n usedmemory: null,\r\n // cache 信息\r\n cache: [],\r\n // key 列表\r\n keyDefineListLoad: true,\r\n keyDefineList: [],\r\n // 模块弹出框\r\n open: false,\r\n keyTemplate: '',\r\n cacheKeys: [],\r\n cacheForm: {},\r\n keyAndValues: [],\r\n multipleSelection: [], // 多选数据\r\n delBtlStatu: true\r\n }\r\n },\r\n created() {\r\n this.getList()\r\n },\r\n methods: {\r\n // 获取redis的信息\r\n getList() {\r\n getCache().then(res => {\r\n // console.log(res)\r\n this.cache = res.info\r\n // this.$model.closeLoading()\r\n this.commandstats = echarts.init(this.$refs.commandstats, 'macarons')\r\n const commandStats = [] // 指令状态数据\r\n res.info.commandStats.forEach(row => {\r\n commandStats.push({\r\n name: row.command,\r\n value: row.calls\r\n })\r\n })\r\n this.commandstats.setOption({\r\n tooltip: {\r\n trigger: 'item',\r\n formatter: '{a}
{b} : {c} ({d}%)'\r\n },\r\n series: [\r\n {\r\n name: '命令',\r\n type: 'pie',\r\n roseType: 'radius',\r\n radius: [15, 95],\r\n center: ['50%', '38%'],\r\n data: commandStats,\r\n animationEasing: 'cubicInOut',\r\n animationDuration: 1000\r\n }\r\n ]\r\n })\r\n // 使用内存信息\r\n this.usedmemory = echarts.init(this.$refs.usedmemory, 'macarons')\r\n this.usedmemory.setOption({\r\n tooltip: {\r\n formatter: '{b}
{a} : ' + this.cache.info.used_memory_human\r\n },\r\n series: [\r\n {\r\n name: '峰值',\r\n type: 'gauge',\r\n min: 0,\r\n max: 1000,\r\n detail: {\r\n formatter: this.cache.info.used_memory_human\r\n },\r\n data: [\r\n {\r\n value: parseFloat(this.cache.info.used_memory_human),\r\n name: '内存消耗'\r\n }\r\n ]\r\n }\r\n ]\r\n })\r\n })\r\n // 查询 Redis Key 模板列表\r\n getKeyDefineList().then(res => {\r\n console.log(res)\r\n this.keyDefineList = res.info\r\n this.keyDefineListLoad = false\r\n })\r\n getKeyValueList().then(res => {\r\n console.log('keyAndValue', res)\r\n this.keyAndValues = res\r\n })\r\n },\r\n clearRedisData(row) {\r\n this.$confirm('此操作将永久删除该redis缓存数据, 是否继续?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n }).then(() => {\r\n const ids = []\r\n ids.push(row.key)\r\n batch(ids).then(res => {\r\n this.$message({\r\n type: 'success',\r\n message: '删除成功!'\r\n })\r\n location.reload()\r\n })\r\n }).catch(() => {\r\n this.$message({\r\n type: 'info',\r\n message: '已取消删除'\r\n })\r\n })\r\n },\r\n handleSelectionChange(val) {\r\n console.log(val)\r\n this.multipleSelection = val\r\n this.delBtlStatu = val.length == 0\r\n },\r\n batchDel() {\r\n this.$confirm('此操作将永久删除' + this.multipleSelection.length + '条缓存数据, 是否继续?', '提示', {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n type: 'warning'\r\n }).then(() => {\r\n const ids = []\r\n for (const i in this.multipleSelection) {\r\n ids.push(this.multipleSelection[i].key)\r\n }\r\n batch(ids).then(res => {\r\n this.$message({\r\n type: 'success',\r\n message: '删除成功!'\r\n })\r\n location.reload()\r\n })\r\n }).catch(() => {\r\n this.$message({\r\n type: 'info',\r\n message: '已取消删除'\r\n })\r\n })\r\n }\r\n }\r\n}\r\n",null]}