Commit 8732d090 by xue_wengang

个人操作日志

parent dab1bf81
<template>
<div class="paneDiv" v-loading='loading'>
<el-row>
<el-col :span="24">
<span class="flTtitle">查询结果</span>
<el-button
plain
class="zdybtn export"
style="float: right; margin-top: 1%; margin-right: 2% !important"
size="small"
@click="exportFile"
>
<i
class="fa fa-external-link"
aria-hidden="true"
style="margin-right: 5px"
></i>
导出
</el-button>
<span class="total">共有{{ dataCount }}条查询结果</span>
</el-col>
</el-row>
<el-row style="padding-top: 10px">
<el-col :span="6">
<table style="width: 100%" border="1" cellpadding="0" cellspacing="0">
<tr>
<th>序号</th>
<th>日时段</th>
<th>次数</th>
</tr>
<tr v-for="(item,index) in dates" :key="index">
<td>{{index}}</td>
<td>{{item}}</td>
<td>{{vals[index]}}</td>
</tr>
</table>
</el-col>
<el-col :span="18">
<div id="e-charts" style="height: 480px"></div>
</el-col>
</el-row>
</div>
</template>
<script>
import request from "@/utils/axiosHttp";
import url from "@/api/base";
import qs from "qs";
export default {
name: "PerspectiveAndAnalysis",
data() {
return {
formData: {},
dates:[],
vals:[],
loading:false
};
},
methods: {
initECharts() {
let myChart = this.$echarts.init(document.getElementById("e-charts"));
myChart.setOption({
xAxis: {
type: "category",
data: this.dates,
},
yAxis: {
type: "value",
},
series: [
{
data: this.vals,
type: "bar",
itemStyle: {
color: "#58a5ff",
},
},
{
data: this.vals,
type: "line",
smooth: false,
itemStyle: {
color: "#298bfe",
},
},
],
});
this.loading = false;
},
exportFile() {
this.qeruestFile(this.formData, "/ywsjTj/exportRyccfx").then((res) => {
let blob = new Blob([res]);
let fileName = "个人操作统计.xlsx";
// 组装a标签
let elink = document.createElement("a");
// 设置下载文件名
elink.download = fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
});
},
detail(sfzh) {
this.$router.pushToTab({
path: "/grczxq",
query: {
...this.formData,
sfzh,
},
});
},
fx() {},
initDate() {
let self = this;
this.loading = true;
let url = "/ywsjTj/queryRyccfx";
this.qeruestPost(this.formData, url).then((res) => {
let { code, data } = res;
if (code == 200) {
for (const key in data) {
this.dates.push(key)
this.vals.push(data[key])
this.initECharts()
}
}
});
},
qeruestFile(form, urls) {
return request({
url: url.rzURL + urls,
data: qs.stringify(form),
responseType: "blob",
method: "post",
headers: {
"content-type": "application/x-www-form-urlencoded",
},
});
},
qeruestPost(form, urls) {
return request({
url: url.rzURL + urls,
data: qs.stringify(form),
method: "post",
headers: {
"content-type": "application/x-www-form-urlencoded",
},
});
},
},
mounted() {
this.formData = this.$route.query;
this.initDate();
},
};
</script>
<style lang="scss" scoped>
.paneDiv {
width: 95%;
background: #ffffff;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.06);
opacity: 1;
border-radius: 4px;
margin: 15px auto;
padding: 20px;
}
</style>
\ No newline at end of file
......@@ -5,6 +5,20 @@
<el-col :span="24">
<span class="flTtitle">查询结果</span>
<span class="total">共有{{ dataCount }}条查询结果</span>
<el-button
plain
class="zdybtn export"
style="float: right; margin-top: 1%; margin-right: 2% !important"
size="small"
@click="exportFile"
>
<i
class="fa fa-external-link"
aria-hidden="true"
style="margin-right: 5px"
></i>
导出
</el-button>
</el-col>
</el-row>
......@@ -26,7 +40,12 @@
>
<el-table-column align="center" label="访问时间" prop="fwsj" />
<el-table-column align="center" label="应用名称" prop="yymc" />
<el-table-column align="center" label="操作参数" prop="czcs" width="300px"/>
<el-table-column
align="center"
label="操作参数"
prop="czcs"
width="300px"
/>
</el-table>
<el-pagination
......@@ -63,6 +82,21 @@ export default {
this.initDate();
},
methods: {
exportFile() {
this.qeruestFile(this.formData, "/ywsjTj/exportRyccxq").then((res) => {
let blob = new Blob([res]);
let fileName = "个人操作统计.xlsx";
// 组装a标签
let elink = document.createElement("a");
// 设置下载文件名
elink.download = fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
});
},
detail(sfzh) {
this.$router.pushToTab({
path: "/grczxq",
......@@ -76,7 +110,8 @@ export default {
initDate() {
let self = this;
this.tableLoading = true;
this.qeruestPost(this.formData).then((res) => {
let url = "/ywsjTj/queryRyccxq";
this.qeruestPost(this.formData, url).then((res) => {
let { code, data, total } = res;
if (code == 200) {
self.tableData = data.rows;
......@@ -85,9 +120,20 @@ export default {
}
});
},
qeruestPost(form) {
qeruestFile(form, urls) {
return request({
url: url.rzURL + urls,
data: qs.stringify(form),
responseType: "blob",
method: "post",
headers: {
"content-type": "application/x-www-form-urlencoded",
},
});
},
qeruestPost(form, urls) {
return request({
url: url.rzURL + "/ywsjTj/queryRyccxq",
url: url.rzURL + urls,
data: qs.stringify(form),
method: "post",
headers: {
......
......@@ -144,11 +144,11 @@ export default {
formData: {
unitCode: "",
yymc: "",
djsjKssj: this.$moment().subtract(1, "year").format("YYYY-MM-DD"),
djsjKssj: this.$moment().subtract(1, "month").format("YYYY-MM-DD"),
djsjJssj: this.$moment().format("YYYY-MM-DD"),
daterange: [],
page: 1,
limit: 10,
limit: "",
},
queryTypeList: [
{ name: "个案侦办", value: "0101" },
......@@ -171,8 +171,29 @@ export default {
},
methods: {
exportFile() {
this.qeruestPost(this.formData, "/ywsjTj/exportRyccfx").then((res) => {
console.log(res)
this.qeruestFile(this.formData, "/ywsjTj/exportRyccfx").then((res) => {
let blob = new Blob([res]);
let fileName = "个人操作统计.xlsx";
// 组装a标签
let elink = document.createElement("a");
// 设置下载文件名
elink.download = fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
document.body.removeChild(elink);
});
},
qeruestFile(form, urls) {
return request({
url: url.rzURL + urls,
data: qs.stringify(form),
responseType: "blob",
method: "post",
headers: {
"content-type": "application/x-www-form-urlencoded",
},
});
},
detail(sfzh) {
......@@ -184,7 +205,15 @@ export default {
},
});
},
fx() {},
fx(sfzh) {
this.$router.pushToTab({
path: "/grczfx",
query: {
...this.formData,
sfzh,
},
});
},
initDate() {
let self = this;
this.tableLoading = true;
......
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