diff --git a/src/views/system/log/index.vue b/src/views/system/log/index.vue index a32c720..8188aac 100644 --- a/src/views/system/log/index.vue +++ b/src/views/system/log/index.vue @@ -1,7 +1,7 @@ @@ -58,67 +46,55 @@ data() { return { infoDrawer: false, - logsChartOption: { - color: ['#409eff','#e6a23c','#f56c6c'], - grid: { - top: '0px', - left: '10px', - right: '10px', - bottom: '0px' - }, - tooltip: { - trigger: 'axis' - }, - xAxis: { - type: 'category', - boundaryGap: false, - data: ['2021-07-01', '2021-07-02', '2021-07-03', '2021-07-04', '2021-07-05', '2021-07-06', '2021-07-07', '2021-07-08', '2021-07-09', '2021-07-10', '2021-07-11', '2021-07-12', '2021-07-13', '2021-07-14', '2021-07-15'] - }, - yAxis: { - show: false, - type: 'value' - }, - series: [{ - data: [120, 200, 150, 80, 70, 110, 130, 120, 200, 150, 80, 70, 110, 130, 70, 110], - type: 'bar', - stack: 'log', - barWidth: '15px' - }, - { - data: [15, 26, 7, 12, 13, 9, 21, 15, 26, 7, 12, 13, 9, 21, 12, 3], - type: 'bar', - stack: 'log', - barWidth: '15px' - }, - { - data: [0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - type: 'bar', - stack: 'log', - barWidth: '15px' - }] - }, - category: [], + chartoption: {}, + typeList: [], date: [], - data: [ - [{id:1}] - ], - // apiObj: this.$api.system.log.list, + data: [], search: { keyword: "" - } + }, + api: '', + params: [], + current : '', + config : {}, + tableColumn : {}, + column : 'default', + currentPage:1, + limit:20, } }, mounted() { this.getType(); }, + watch: { + + //监听从props里拿到值了 + current(){ + this.getCurrent(); + }, + }, methods: { + //树点击 + nodeClick(data){ + if (data.disabled) { + return false; + } + this.current = data.label; + this.column = data.column || 'column'; + }, getType(){ this.$http.get('log/admin/types', {}, { cacheparameters: true }).then((res) => { if (res.code == 200) { - this.category= res.data + Object.assign(this.$data, res.data); } }); }, + getCurrent(){ + this.tableColumn = this.config[this.column] || this.config.default; + this.params = { type: this.current } + this.api = 'log/admin/lists' + this.$refs.table.reload(this.params) + }, upsearch(){ }, diff --git a/src/views/system/log/info.vue b/src/views/system/log/info.vue index bdb3fca..ee1bea8 100644 --- a/src/views/system/log/info.vue +++ b/src/views/system/log/info.vue @@ -1,28 +1,21 @@