许宏杰 1 year ago
commit 23cf99bcc4

@ -4,6 +4,6 @@ ENV = 'development'
# base api # base api
VUE_APP_BASE_API = '/dashboard' VUE_APP_BASE_API = '/dashboard'
VUE_APP_BASE_API2 = 'http://192.168.0.110:9027' VUE_APP_BASE_API2 = 'http://192.168.0.106:9027'
BASE_API = 'http://10.10.3.35:9070' BASE_API = 'http://10.10.3.35:9070'

@ -20,4 +20,11 @@ export function safeRisks() {
url: '/zongzhi/saftyscreen/safetyhazard', url: '/zongzhi/saftyscreen/safetyhazard',
method: 'get', method: 'get',
}) })
}
//部门专办情况
export function sectorZB() {
return request({
url: '/zongzhi/opinionscreen/sentimentdept',
method: 'get',
})
} }

@ -11,59 +11,63 @@
</template> </template>
<script> <script>
import { getyqZblNum } from '@/api/common' import { getyqZblNum } from "@/api/common";
import { sectorZB } from "@/api/wlSafe";
export default { export default {
data() { data() {
return { return {
lineName: ['消防部', '公安部', '通信部', '档案部', '后勤部', '审查部'], lineName: [],
lineValue: [10, 20, 5, 6, 1, 30] lineValue: [],
} };
}, },
mounted() { mounted() {
this.lineBox() this.getData()
// getyqZblNum().then(res => {
// res.data.forEach(ele => {
// this.lineName.push(ele.deptName)
// this.lineValue.push(ele.referralCount)
// })
// this.lineBox()
// }
// )
}, },
methods: { methods: {
getData() {
sectorZB().then((res) => {
res.data.forEach(value => {
this.lineName.push(value.dep_name)
this.lineValue.push(value.count)
});
this.lineBox();
});
},
lineBox() { lineBox() {
const myChart = this.$echarts.init(document.getElementById('box2')) const myChart = this.$echarts.init(document.getElementById("box2"));
const options = ({ const options = {
animation: true, animation: true,
grid: { grid: {
top: '6.5%', top: "6.5%",
bottom: '15%', bottom: "15%",
right: '5%' right: "5%",
}, },
title: { title: {
text: '单位:件', text: "单位:件",
textStyle: { textStyle: {
align: 'center', align: "center",
color: 'rgba(255,255,255,0.5)', color: "rgba(255,255,255,0.5)",
fontSize: 24 fontSize: 24,
}, },
top: '-4px', top: "-4px",
left: '11%' left: "11%",
}, },
xAxis: { xAxis: {
data: this.lineName, data: this.lineName,
axisLine: { axisLine: {
show: false // X线 show: false, // X线
}, },
axisTick: { axisTick: {
show: false // X线 show: false, // X线
}, },
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: 'rgba(77, 128, 254, 0.2)', color: "rgba(77, 128, 254, 0.2)",
width: 2 width: 2,
} },
}, },
axisLabel: { axisLabel: {
show: true, show: true,
@ -71,184 +75,183 @@ export default {
margin: 20, margin: 20,
fontSize: 18, fontSize: 18,
textStyle: { textStyle: {
color: '#65D5FF' // X color: "#65D5FF", // X
}, },
formatter: function(params) { formatter: function (params) {
var newParamsName = '' // var newParamsName = ""; //
var paramsNameNumber = params.length // var paramsNameNumber = params.length; //
var provideNumber = 5 // var provideNumber = 5; //
var rowNumber = Math.ceil(paramsNameNumber / provideNumber) // var rowNumber = Math.ceil(paramsNameNumber / provideNumber); //
if (paramsNameNumber > provideNumber) { if (paramsNameNumber > provideNumber) {
/** 循环每一行,p表示行 */ /** 循环每一行,p表示行 */
for (var i = 0; i < rowNumber; i++) { for (var i = 0; i < rowNumber; i++) {
var tempStr = '' // var tempStr = ""; //
var start = i * provideNumber // var start = i * provideNumber; //
var end = start + provideNumber // var end = start + provideNumber; //
// //
if (i === rowNumber - 1) { if (i === rowNumber - 1) {
tempStr = params.substring(start, paramsNameNumber) tempStr = params.substring(start, paramsNameNumber);
} else { } else {
tempStr = params.substring(start, end) + '\n' tempStr = params.substring(start, end) + "\n";
} }
newParamsName += tempStr newParamsName += tempStr;
} }
} else { } else {
newParamsName = params newParamsName = params;
} }
return newParamsName return newParamsName;
} },
} },
}, },
yAxis: [ yAxis: [
{ {
type: 'value', type: "value",
gridIndex: 0, gridIndex: 0,
min: 0, min: 0,
max: (value) => { max: (value) => {
if (value.max < 10) { if (value.max < 10) {
return 10 return 10;
} else { } else {
return Math.ceil(value.max / 10) * 10 return Math.ceil(value.max / 10) * 10;
} }
}, },
splitNumber: 5, splitNumber: 5,
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: 'rgba(77, 128, 254, 0.2)', color: "rgba(77, 128, 254, 0.2)",
width: 2 width: 2,
} },
}, },
axisTick: { axisTick: {
show: false show: false,
}, },
axisLine: { axisLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: 'rgba(77, 128, 254, 0.2)' color: "rgba(77, 128, 254, 0.2)",
} },
}, },
axisLabel: { axisLabel: {
show: true, show: true,
margin: 14, margin: 14,
fontSize: 20, fontSize: 20,
textStyle: { textStyle: {
color: '#65D5FF' color: "#65D5FF",
} },
} },
} },
], ],
series: [ series: [
{ {
name: '单数', name: "单数",
type: 'bar', type: "bar",
barWidth: 16, barWidth: 16,
itemStyle: { itemStyle: {
normal: { normal: {
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [ color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ {
offset: 0, offset: 0,
color: 'rgba(146, 225, 255, 1)' color: "rgba(146, 225, 255, 1)",
}, },
{ {
offset: 1, offset: 1,
color: 'rgba(0, 151, 251, 1)' color: "rgba(0, 151, 251, 1)",
} },
]) ]),
} },
}, },
data: this.lineValue, data: this.lineValue,
z: 10, z: 10,
zlevel: 0, zlevel: 0,
label: { label: {
show: true, show: true,
position: 'top', position: "top",
textStyle: { textStyle: {
color: '#ffffff' color: "#ffffff",
} },
} },
}, },
{ {
// //
type: 'pictorialBar', type: "pictorialBar",
itemStyle: { itemStyle: {
normal: { normal: {
color: '#0F375F' color: "#0F375F",
} },
}, },
symbolRepeat: 'fixed', symbolRepeat: "fixed",
symbolMargin: 6, symbolMargin: 6,
symbol: 'rect', symbol: "rect",
symbolClip: true, symbolClip: true,
symbolSize: [18, 2], symbolSize: [18, 2],
symbolPosition: 'start', symbolPosition: "start",
symbolOffset: [1, 1], symbolOffset: [1, 1],
data: this.lineValue, data: this.lineValue,
width: 2, width: 2,
z: 0, z: 0,
zlevel: 1 zlevel: 1,
}, },
{ {
type: 'bar', type: "bar",
barGap: '-110%', // barGap: "-110%", //
data: [10, 10, 10, 10, 10, 10, 10], data: [10, 10, 10, 10, 10, 10, 10],
barWidth: 16, barWidth: 16,
itemStyle: { itemStyle: {
normal: { normal: {
color: 'transparent', // color: "transparent", //
// barBorderRadius: 0, // // barBorderRadius: 0, //
label: { label: {
// //
show: false, show: false,
position: 'top' // insideTop insideLeft position: "top", // insideTop insideLeft
} },
} },
}, },
z: 0 z: 0,
}, },
{ {
type: 'line', type: "line",
smooth: true, // 线 smooth: true, // 线
showAllSymbol: false, // showAllSymbol: false, //
symbolSize: 0, symbolSize: 0,
lineStyle: { lineStyle: {
width: 0 width: 0,
}, },
areaStyle: { areaStyle: {
color: 'rgba(0, 151, 251, 0.5)' color: "rgba(0, 151, 251, 0.5)",
}, },
data: this.lineValue data: this.lineValue,
} },
], ],
dataZoom: [ dataZoom: [
{ {
type: 'slider', type: "slider",
show: false, show: false,
xAxisIndex: [0], xAxisIndex: [0],
endValue: 5, endValue: 5,
startValue: 0 startValue: 0,
} },
] ],
}) };
if (options && typeof options === 'object') { if (options && typeof options === "object") {
myChart.setOption(options, true) myChart.setOption(options, true);
// //
setInterval(() => { setInterval(() => {
if (options.dataZoom[0].endValue === this.lineValue?.length) { if (options.dataZoom[0].endValue === this.lineValue?.length) {
options.dataZoom[0].endValue = 5 options.dataZoom[0].endValue = 5;
options.dataZoom[0].startValue = 0 options.dataZoom[0].startValue = 0;
} else { } else {
options.dataZoom[0].endValue = options.dataZoom[0].endValue + 1 options.dataZoom[0].endValue = options.dataZoom[0].endValue + 1;
options.dataZoom[0].startValue = options.dataZoom[0].startValue + 1 options.dataZoom[0].startValue = options.dataZoom[0].startValue + 1;
} }
myChart.setOption(options, true) myChart.setOption(options, true);
}, 2000) }, 2000);
} }
} },
} },
} };
</script> </script>
<style lang='scss' scoped> <style lang='scss' scoped>
#box2 { #box2 {

@ -69,17 +69,17 @@
<div class="Special-report" @click="reportDetails('专报')"> <div class="Special-report" @click="reportDetails('专报')">
<div class="Special-icon"></div> <div class="Special-icon"></div>
<div class="Special-title">专报</div> <div class="Special-title">专报</div>
<div class="Special-num">{{ filteryqbg(1) }}</div> <div class="Special-num">{{ Transfer[0].bg }}</div>
</div> </div>
<div class="Monthly-report" @click="reportDetails('月报')"> <div class="Monthly-report" @click="reportDetails('月报')">
<div class="Monthly-icon"></div> <div class="Monthly-icon"></div>
<div class="Monthly-title">月报</div> <div class="Monthly-title">月报</div>
<div class="Monthly-num">{{ filteryqbg(2) }}</div> <div class="Monthly-num">{{ Transfer[1].bg }}</div>
</div> </div>
<div class="depth-report" @click="reportDetails('深度报告')"> <div class="depth-report" @click="reportDetails('深度报告')">
<div class="depth-icon"></div> <div class="depth-icon"></div>
<div class="depth-title">深度报告</div> <div class="depth-title">深度报告</div>
<div class="depth-num">{{ filteryqbg(3) }}</div> <div class="depth-num">{{ Transfer[2].bg }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -222,21 +222,23 @@
text-align: center; text-align: center;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center;
" "
> >
<div <div
v-if="fileExtension === 'docx' || fileExtension === 'doc'" v-if="fileExtension === 'docx' || fileExtension === 'doc'"
ref="file" ref="file1"
class="file-content" class="file-content"
></div> ></div>
<div v-if="fileExtension === 'pdf'" class="file-content"> <div v-if="fileExtension === 'pdf'" class="file-content">
<pdf <!-- <pdf
v-for="i in numPages" v-for="i in numPages"
ref="pdf" ref="pdf"
:key="i" :key="i"
:src="pdfUrl" :src="pdfUrl"
:page="i" :page="i"
></pdf> ></pdf> -->
<iframe style="height: 100%; width: 100%" :src="pdfUrl"></iframe>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -340,7 +342,21 @@ export default {
turnTime: null, turnTime: null,
tsdNum: 461, tsdNum: 461,
zbdNum: 475, zbdNum: 475,
Transfer: {}, Transfer: [
{
type: 1,
bg: 0,
},
{
type: 2,
bg: 0,
},
{
type: 3,
bg: 0,
},
],
turnDetailsList: [], turnDetailsList: [],
sentimeentList: { sentimeentList: {
options: ["转办量", "转办详情"], options: ["转办量", "转办详情"],
@ -359,9 +375,9 @@ export default {
// //
fileExtension: "", fileExtension: "",
numPages: 1, numPages: 1,
pdfUrl: "",
currentWarningObj: {}, currentWarningObj: {},
//=================== //===================
pdfUrl: "",
formData: { formData: {
pageSize: 1, pageSize: 1,
pageNum: 1, pageNum: 1,
@ -437,17 +453,19 @@ export default {
this.getOneList(); this.getOneList();
}, },
methods: { methods: {
filteryqbg(e) {
let arr = this.Transfer.reportList.filter((value) => {
return value.sentimentReportType == e;
});
return arr[0].count;
},
getDataList() { getDataList() {
yqbg().then((res) => { yqbg().then((res) => {
this.tsdNum = res.data.reminder; this.tsdNum = res.data.reminder;
this.zbdNum = res.data.isturn; this.zbdNum = res.data.isturn;
this.Transfer = res.data; res.data.reportList.forEach((value, index) => {
this.Transfer.forEach((value1, index1) => {
if (value.sentimentReportType == value1.type) {
this.Transfer[index1].bg = value.count;
return;
}
});
});
console.log(this.Transfer);
}); });
// //
yuqingListA().then((res) => { yuqingListA().then((res) => {
@ -546,40 +564,31 @@ export default {
this.newbgForm.pageNum = val; this.newbgForm.pageNum = val;
this.getyqbgType(); this.getyqbgType();
}, },
rowClick(row, type) { rowClick(row) {
this.dialogDetails = true; if (!row.fileName && !row.fileUrl) return;
let str = row.fileName.split("."); let str = row.fileUrl.split(',')
this.fileExtension = str[1]; let str1 = str[0].split('.')
}, this.fileExtension = str1[1];
if (this.fileExtension == "pdf") {
getNumPages(url) { this.pdfUrl = process.env.VUE_APP_BASE_API2 + str[0];
axios({ this.dialogDetails = true;
method: "GET", } else if (
url: url, // this.fileExtension === "docx" ||
paramsSerializer: function (params) { this.fileExtension === "doc"
return qs.stringify(params, { arrayFormat: "brackets" }); ) {
}, axios({
headers: { method: "get",
"Content-Type": responseType: "blob", //
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", url: process.env.VUE_APP_BASE_API2 + str[0],
}, }).then(({ data }) => {
responseType: "blob", if (data) {
}) this.dialogDetails = true;
.then((response) => { this.$nextTick(() => {
this.pdfUrl = this.getObjectURL(response.data); docx.renderAsync(data, this.$refs.file1); //
const loadingTask = pdf.createLoadingTask(this.pdfUrl);
loadingTask.promise
.then((pdf) => {
this.numPages = pdf.numPages;
this.dialogDetails = true;
})
.catch((err) => {
console.error("pdf 加载失败", err);
}); });
}) }
.catch((error) => {
this.$message.error("" + error);
}); });
}
}, },
// url // url
getObjectURL(file) { getObjectURL(file) {

Loading…
Cancel
Save