部门转办情况

lijinlong
杜函宇 1 year ago
parent b58e124765
commit 1a2652c000

@ -4,6 +4,6 @@ ENV = 'development'
# base api
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'

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

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

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

Loading…
Cancel
Save