Commit 20744b07 authored by 李苏's avatar 李苏 💬

有限空间作业

parent d4aec598
{
"name": "GavelDmg",
"version": "0.0.1",
"description": "GavelDmg",
"author": "Gavel",
"license": "MIT",
"scripts": {
"clear": "rmdir /s/q node_modules",
"serve": "vue-cli-service serve",
"devbuild": "vue-cli-service build --mode development",
"build": "vue-cli-service build",
"build:report": "vue-cli-service build --report",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"keywords": [
"vue",
"admin",
"dashboard",
"element-ui",
"boilerplate",
"admin-template",
"management-system"
],
"repository": {
"type": "git",
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.24.0",
"clipboard": "2.0.8",
"common": "file:/Users/forwards/Dev/common",
"core-js": "3.19.1",
"echarts": "^4.9.0",
"element-ui": "2.15.8",
"file-saver": "2.0.5",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"nprogress": "0.2.0",
"quill": "1.3.7",
"screenfull": "5.0.2",
"sortablejs": "1.10.2",
"typescript": "^4.5.2",
"vue": "2.6.12",
"vue-class-component": "^7.2.3",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-meta": "2.4.0",
"vue-router": "3.4.9",
"vue-seamless-scroll": "^1.1.23",
"vue-video-player": "5.0",
"vuedraggable": "^2.24.3",
"vuex": "3.6.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
"@vue/cli-plugin-eslint": "4.4.6",
"@vue/cli-service": "4.4.6",
"babel-eslint": "10.1.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-plugin-transform-remove-debugger": "^6.9.4",
"chalk": "4.1.0",
"compression-webpack-plugin": "5.0.2",
"connect": "3.6.6",
"eslint": "7.15.0",
"eslint-plugin-vue": "7.2.0",
"lint-staged": "10.5.3",
"runjs": "4.4.2",
"sass": "1.32.13",
"sass-loader": "10.1.1",
"script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1",
"ts-loader": "~8.2.0",
"vue-particles": "^1.0.9",
"vue-property-decorator": "^9.1.2",
"vue-template-compiler": "2.6.12"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
{
"name": "GavelDmg",
"version": "0.0.1",
"description": "GavelDmg",
"author": "Gavel",
"license": "MIT",
"scripts": {
"clear": "rmdir /s/q node_modules",
"serve": "vue-cli-service serve",
"devbuild": "vue-cli-service build --mode development",
"build": "vue-cli-service build",
"build:report": "vue-cli-service build --report",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",
"lint": "eslint --ext .js,.vue src"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"keywords": [
"vue",
"admin",
"dashboard",
"element-ui",
"boilerplate",
"admin-template",
"management-system"
],
"repository": {
"type": "git",
"url": "https://gitee.com/y_project/RuoYi-Vue.git"
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.24.0",
"clipboard": "2.0.8",
"common": "file:D://common",
"core-js": "3.19.1",
"echarts": "^4.9.0",
"element-ui": "2.15.8",
"file-saver": "2.0.5",
"fuse.js": "6.4.3",
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"jsencrypt": "3.0.0-rc.1",
"nprogress": "0.2.0",
"quill": "1.3.7",
"screenfull": "5.0.2",
"sortablejs": "1.10.2",
"typescript": "^4.5.2",
"vue": "2.6.12",
"vue-class-component": "^7.2.3",
"vue-count-to": "1.0.13",
"vue-cropper": "0.5.5",
"vue-meta": "2.4.0",
"vue-router": "3.4.9",
"vue-seamless-scroll": "^1.1.23",
"vue-video-player": "5.0",
"vuedraggable": "^2.24.3",
"vuex": "3.6.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
"@vue/cli-plugin-eslint": "4.4.6",
"@vue/cli-service": "4.4.6",
"babel-eslint": "10.1.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-plugin-transform-remove-debugger": "^6.9.4",
"chalk": "4.1.0",
"compression-webpack-plugin": "5.0.2",
"connect": "3.6.6",
"eslint": "7.15.0",
"eslint-plugin-vue": "7.2.0",
"lint-staged": "10.5.3",
"runjs": "4.4.2",
"sass": "1.32.13",
"sass-loader": "10.1.1",
"script-ext-html-webpack-plugin": "2.1.5",
"svg-sprite-loader": "5.1.1",
"ts-loader": "~8.2.0",
"vue-particles": "^1.0.9",
"vue-property-decorator": "^9.1.2",
"vue-template-compiler": "2.6.12"
},
"engines": {
"node": ">=8.9",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
import request from 'common/src/utils/request'
/* query */
export function doQuery(query) {
return request({
url: '/aqgl/yxkjzygl/query',
method: 'post',
data: query||{}
})
}
/* 更新 */
export function doUpdate(query) {
return request({
url: '/aqgl/yxkjzygl/update',
method: 'post',
data: query||{}
})
}
export function doAdd(query) {
return request({
url: '/aqgl/yxkjzygl/add',
method: 'post',
data: query||{}
})
}
export function doDelete(query) {
return request({
url: '/aqgl/yxkjzygl/delete',
method: 'post',
data: query||{}
})
}
export function doQuerytree(query) {
return request({
url: '/aqgl/yxkjzygl/query/tree',
method: 'post',
data: query||{}
})
}
......@@ -488,19 +488,19 @@ export const powerRoutes=[
redirect: 'maintainTV',
meta: {title: "三违管理", icon: "fa-cog", noCache: false, link: null,mkid:904000000},
children: [
{
component:'threeViolations/homePage/index',
hidden:false,
meta:{
"title": "首页",
"icon": "",
"noCache": false,
"link": null,
"mkid":'test',
},
name:'homePage',
path:"homePage"
},
// {
// component:'threeViolations/homePage/oldIndex',
// hidden:false,
// meta:{
// "title": "首页",
// "icon": "",
// "noCache": false,
// "link": null,
// "mkid":'test',
// },
// name:'homePage',
// path:"homePage"
// },
{
component:'threeViolations/maintainTV/index',
hidden:false,
......@@ -1426,6 +1426,30 @@ export const powerRoutes=[
path:"archives"
}
]
},
/* 有限空间作业*/
{
path: '/spaceOperations',
component: 'Layout',
hidden: false,
alwaysShow:true,
redirect: 'declare',
meta: {title: "有限空间作业", icon: "fa-cog", noCache: false, link: null,mkid:905000000},
children: [
{
component:'spaceOperations/declare/index',
hidden:false,
meta:{
"title": "外协单位准入申报",
"icon": "",
"noCache": false,
"link": null,
"mkid":905002000,
},
name:'declare',
path:"declare"
}
]
}
]
// 公共路由
......
<template>
<div style="display: flex;">
<el-dialog
:fullscreen='true'
append-to-body
:visible.sync="show"
width="100%"
>
<div ref='show' v-if="show" style="height: 85vh;width: 100%;position: relative;">
<div v-if="showType=='pdf'" style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 60px;" @click="showSize=b" ></div>
<div v-if="showType=='pdf'" style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 90px;" @click="showSize=m" ></div>
<div v-if="showType=='pdf'" style="color: #d9d9d9;font-size: 16px;position: fixed;right: 50px;cursor: pointer;top: 120px;" @click="showSize=s" ></div>
<div :style="showSize" style='height: 85vh;width: 100%;'>
<pdf ref="show" v-if="showType=='pdf'" v-for="i in numPages" :key="i" :src="url" :page="i" ></pdf>
</div>
<!-- <iframe v-if="showType=='pdf'" :src="url" width="100%" height="100%" border="0"></iframe> -->
<img v-if="['gif','jpg','jpeg','png','bmp'].indexOf(showType)!=-1" :src="url" style="max-height: 100%;position: absolute;
left: 50%;
top: 50%;;
transform: translate(-50%,-50%);
" border="0" >
</div>
</el-dialog>
<div id='approvefileAdd1' style="display: none;" >
<input @change='beginUpload' id='aqglfilesonadd' ref="upload" type="file" style="display: none;">
</div>
<div class="min_full" style="width: 200px;border-right: 0px;">
<TreeBase :dgtype='3' :app='this' @selected='selectedTree'></TreeBase>
</div>
<div class="min_full" style="overflow: auto;width: calc(100% - 200px)">
<div class="min_full" style="calc(60vh - 42px)">
<!-- 查询条件-->
<div class="search" v-condition>
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">文档标题:</span>
<el-input v-model="queryParams.title"></el-input>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar" >
<PrintButton :app='this'></PrintButton>
<EditButton ref="add" :app='this'></EditButton>
<!-- <ViewButton ref="view" :app='this'></ViewButton>
<CopyButton ref="copy" :app='this'></CopyButton>
<FieldButton :app='this'></FieldButton>
<ExcelButton :app='this'></ExcelButton> -->
<!-- <AttachFileButton :app='this' ></AttachFileButton> -->
<el-button @click="upload" size='mini' type="primary">新增</el-button>
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager v-loading='isupLoad' @getData='getData' :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem'
@getRow='getRow'>
<template slot="tabCustom">
<el-table-column label="附件操作" width="160" header-align="center" fixed="right" >
<template slot-scope="scope">
<div style="width: 100%;display: flex;">
<el-button style="text-align: center;color: #3399ff;width: 33.3%;"
@click.native.prevent="preview(scope.row)" type="text" size="small">
<i class="el-icon-view"></i>预览
</el-button>
<el-button v-show="app.powerObj['91']" style="text-align: center;color: #3399ff;width: 33.3%;"
@click.native.prevent="downLoad(scope.row)" type="text" size="small">
<i class="el-icon-download"></i>下载
</el-button>
<el-button style="text-align: center;color: #3399ff;width: 33.3%;"
@click.native.prevent="upload('update',scope.row)" type="text" size="small">
<i class="el-icon-upload2"></i>更新
</el-button>
</div>
</template>
</el-table-column>
</template>
</TablePager>
</div>
</div>
<!-- <MainIndex :vMain='this' ref="mainIndex" ></MainIndex>
<LessIndex :vMain='this' ref="lessIndex" ></LessIndex> -->
</div>
</div>
</template>
<script>
import {pdf} from 'common'
import {
doQuerytree
} from "@/api/spaceOperations/declare.js";
import {
autoAttachPreview,
autoAttach,
autoAttachDownload,
deleteAttachDownload,
uploadAttachDownload,
uploadUpdate
// aqglUploadUpdate
} from "common/src/api/system/dmgSystem.js";
import {
doQuery,
doDelete,
doUpdate
} from "@/api/spaceOperations/declare.js";
import Edit from './lessEdit.vue'
import {tableMixin} from 'common'
// import MainIndex from './mainIndex.vue'
// import LessIndex from './lessIndex.vue'
export default {
mixins: [tableMixin],
components:{
// MainIndex,
// LessIndex,
Edit,
pdf
},
data() {
return{
showSize:'transform:scale(0.36)',
s:'transform:scale(0.36)',
m:'transform:scale(0.6)',
b:'transform:scale(0.9)',
numPages:1,
show:false,
isupLoad:false,
treeTitle: '目录',
treeDefaultProps: {
children: 'children',
label: 'bmmc'
},
// 额外
typeMap: [],
systemType: [],
baseUrl: 'aqgl/yxkjzygl',
/* 查询参数*/
queryParams: {
mlid:'',
title:'',
gsid:''
},
treeQueryParams:{
},
/* 表格标题对应参数*/
tableTitle: [
{prop: 'title', label: '文档名称', width: '340'},
{prop: 'fileVersion', label: '版本', width: '60'},
{prop: 'createTime', label: '上传时间', fieldType: "ftDateTime"},
{prop: 'updUserName', label: '上传人', width: "80"},
{prop: 'fileSize', label: '大小', width: '70',
formatter:function(a,b,bytes){
if(!bytes){
return '未上传文件'
}
if (bytes === 0) return '0 B';
var k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
}
]
}
},
methods:{
getNumPages(url) {
var loadingTask = pdf.createLoadingTask(url)
loadingTask.promise.then(pdf => {
this.url = loadingTask
this.numPages = pdf.numPages
}).catch((err) => {
console.error('pdf加载失败')
})
},
/* 预览 */
preview(row){
console.log(row)
this.showType=row.fileType
let canShow=['gif','jpg','jpeg','png','bmp','pdf'].indexOf(row.fileType)==-1
if(canShow){
this.$warning('该文件不支持预览,请直接下载')
return
}
autoAttachPreview({},'aqgl/yxkjzygl',row.fileId).then(res=>{
if(res.type=='application/json'){
this.$warning('您没有权限,请联系系统管理员!')
return
}
let blob = new Blob([res], {
type: 'application/'+row.fileType+';charset=UTF-8',
});
this.url=URL.createObjectURL(blob)
this.getNumPages(this.url)
this.show=true
this.$nextTick(()=>{
this.$refs.show.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false );
})
})
},
creatFile(){
/* 清除老节点 */
$('#approvefileAdd1').find('input').remove()
let lineEl = document.createElement('input');
let $lineEl=$(lineEl)
$lineEl.attr('type','file')
$lineEl.attr('ref','upload')
$lineEl.attr('id','aqglfilesonadd')
$lineEl.hide()
$lineEl.change(()=>{
this.beginUpload()
})
// $lineEl
$('#approvefileAdd1').append($lineEl)
},
beginUpload(){
this.isupLoad=true
let uploadDom=document.getElementById('aqglfilesonadd')
var filec = uploadDom.files[0];
var name = filec.name
var type = filec.type
let updateId=$(uploadDom).attr('inputId')
updateId&&$(uploadDom).attr('inputId',null)
if (filec) {
let formData = new FormData();
formData.append('file', filec)
formData.append('type', type)
formData.append('folder', '')
formData.append('name', name)
if(updateId){
formData.append('id', updateId)
this.creatFile()
uploadUpdate(formData,'aqgl/yxkjzygl').then(res => {
if (res.success) {
this.$success('更新成功')
this.isupLoad=false
this.$refs['TablePager'].reLoad()
}
}).catch(e=>{
console.error(e)
this.isupLoad=false
})
return
}
formData.append('groupid', this.queryParams.gsid)
this.creatFile()
uploadAttachDownload(formData,'aqgl/yxkjzygl').then(res => {
if (res.success) {
this.$success('添加成功')
this.isupLoad=false
this.$refs['TablePager'].reLoad()
}
}).catch(e=>{
console.error(e)
this.isupLoad=false
})
}
},
upload(){
let $upload=$('#aqglfilesonadd')
arguments[0]=='update'&&$upload.attr('inputId',arguments[1].fileId)&&$upload.click()
if(arguments[0]=='update'){
return
}
else if (this.queryParams.gsid ){
$upload.click()
/* 上传*/
}else{
this.$warning('请选中公司操作操作');
}
},
down(data,type,title) {
let a = document.createElement('a');
a.download = title;
a.style.display = 'none';
let blob = new Blob([data], {
type: 'application/'+type+';charset=UTF-8',
});
a.href = URL.createObjectURL(blob);
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
},
downLoad(row){
let title=row.fileName
autoAttachDownload({},'aqgl/yxkjzygl',row.fileId).then(res=>{
if(res.type=='application/json'){
this.$warning('您没有【下载】权限,请联系系统管理员!')
return
}
this.down(res,row.type,title)
})
},
selectedTree(val){
if(val.type=='ML'){
this.queryParams.gsid=val.gsid
this.queryParams.mlid=val.id
}else{
this.queryParams.gsid=val.id
this.queryParams.mlid=''
}
this.$refs['TablePager'].pageQuery()
},
/* 基础查询*/
query: doQuery,
apiDelete:doDelete,
apiUpdate:doUpdate,
apiTreeQuery: doQuerytree,
}
}
</script>
<style>
</style>
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="标题" ref="title" prop="title">
<el-input :readonly="readonly" v-model="form.title"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</RelDialog>
</template>
<script>
import {editMixin} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
// this.form.mlid=this.app.queryParams.mlid
this.form.gsid=this.app.queryParams.gsid
},
/* 组件名称*/
name: 'appVersionEdit',
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 额外初始化,根据需求*/
systemType: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
mlid:'',
gsid:'',
title: '',
sytk: '',
bz: "",
fbrq:new Date().getTime(),
ssrq:new Date().getTime(),
mlid:''
},
/* form提交时的规则,具体规则参考官网*/
rules: {
gsid: [{
required: true,
}, ],
}
}
},
methods: {
/* 重写方法,this.app来调用index页面定义的api*/
}
}
</script>
<style scoped lang="scss">
</style>
......@@ -15,7 +15,7 @@
<el-tooltip :content="`${item.gsName}${item.bzName||''}:${item.wzr}:${item.wzxw}`" placement="top">
<span class='infor' >
{{`${item.gsName}${item.bzName||''}的${item.wzr}做出违章行为:${item.wzxw}`}}
</span>
</el-tooltip>
</div>
......@@ -45,7 +45,7 @@
<el-tooltip :content="`${item.gsName}${item.userName||''}:${item.bytitle}:${item.bycont}`" placement="top">
<span class='infor' >
{{`${item.gsName}${item.bzName||''}的${item.userName}:${item.bytitle}`}}
</span>
</el-tooltip>
</div>
......@@ -70,16 +70,16 @@
</div>
<div class="ztcxxx">
<div class="search-item" style="padding-left: 20px;border-bottom: 2px solid #eee;">
<el-radio v-model="queryParams1.rwlx" label="D">日任务</el-radio>
<el-radio v-model="queryParams1.rwlx" label="W">周任务</el-radio>
<el-radio v-model="queryParams1.rwlx" label="M">月任务</el-radio>
</div>
</div>
<!-- 图表-->
<div id="fxpcChart" class="chart" >
</div>
</div>
<div class="top_right_yhhz">
......@@ -87,26 +87,26 @@
隐患处理完成率
</div>
<div class="ztcxxx" style="padding-left: 0px;" >
<div class="search-item" style="border-bottom: 2px solid #eee;padding-left: 10px;" >
<RelSelect style="width: 200px;margin-right: 10px;" hasValue src='jcsj/common/bm/queryGs' filterable :match="{value:'id',label:'bmmc'}" v-model='queryParams1.gsid' ></RelSelect>
<!-- <el-radio v-model="queryParams2.hzfs" label="GS">按公司</el-radio>
<el-radio v-model="queryParams2.hzfs" label="BM">按班组</el-radio>
<el-radio v-model="queryParams2.hzfs" label="RY">按人员</el-radio> -->
</div>
</div>
<div id="yhclChart" class="chart" >
</div>
</div>
</div>
<!-- 隐患率-->
<!-- 风险率-->
</div>
<div class="bottom">
<div class="zttitle">
......@@ -118,11 +118,11 @@
</TablePager>
</div>
</div>
</div>
</template>
<script>
const baseurl=process.env.VUE_APP_BASE_API
import {
......@@ -137,11 +137,11 @@
import {
queryYhsbtj as doQueryyh
} from "@/api/dangerManagement/yhslhz.js";
import {
doQuery as doQueryDcl
} from "@/api/dangerManagement/enterSafetyRecords.js"
import {
queryBglxFile
} from '@/api/threeViolations/enterTV.js';
......@@ -151,7 +151,7 @@
import ryqno from '@/assets/images/ryqno.png'
export default{
components: {
vueSeamlessScroll
},
mixins: [tableMixin],
......@@ -193,8 +193,8 @@
this.fxpcChart=echarts.init(document.getElementById('fxpcChart'))
this.yhclChart=echarts.init(document.getElementById('yhclChart'))
this.$nextTick(()=>{
// this.setChart(this.yhclChart,{
// name:'隐患整改完成率',
// title:'隐患整改'
......@@ -225,8 +225,8 @@
// }},
// {label: "整改说明", prop: "clff", fieldType: "ftString",width:300},
// {label: "整改完成时间", prop: "clsj", fieldType: "ftDateTime"},
{label: "发现日期", prop: "fxrq", fieldType: "ftDateTime"},
/* */
{label: "整改日期", prop: "clsj", fieldType: "ftDateTime"},
......@@ -274,10 +274,10 @@
gsid:'',
// ksrq:new Date(new Date().setHours(0, 0, 0, 0)).getTime(),
// jsrq:new Date(new Date().setHours(23,59,59,999)).getTime()
ksrq:new Date().getTime(),
jsrq:new Date().getTime()
},
queryParams2:{
hzfs:'GS',
......@@ -285,7 +285,7 @@
ksrq:null,
jsrq:new Date().getTime()
// jsrq:new Date(new Date().setHours(23,59,59,999)).getTime()
},
queryParams:{
queryType:'YHWCL'
......@@ -298,7 +298,7 @@
/* dom*/
fxpcChart:null,
yhclChart:null,
}
},
methods:{
......@@ -331,7 +331,7 @@
title:'风险排查',
value:value
})
}
})
},
......@@ -366,7 +366,7 @@
title:'隐患整改',
value:value
})
}
})
},
......@@ -377,7 +377,7 @@
tooltip: {
formatter: '{a} <br/>{b} : {c}%'
},
series: [
{
axisLine: {
......@@ -406,7 +406,7 @@
textStyle:{
fontSize:17
}
},
data: [
{
......@@ -420,11 +420,11 @@
/* 渲染dom*/
chartDom.setOption(option)
}
}
}
</script>
<style lang="scss" scope>
.listf{
float: right;
......@@ -471,12 +471,12 @@
border-left: 5px solid #eee;
border-right: 5px solid #eee;
}
.homePage{
width: 35%;
height: 100%;
}
.nodata{
background-image: url('/src/assets/image/aq.svg');
......@@ -512,9 +512,8 @@
.el-carousel__item:nth-child(2n) {
background-color: #99a9bf;
}
.el-carousel__item:nth-child(2n+1) {
background-color: #d3dce6;
}
</style>
\ No newline at end of file
<template>
<!-- 外层排版-->
<div class="min_full " style="margin: 0;border: 0;background-color: #fff;">
<!-- 上层布局-->
<div class="top" style="border: 5px solid #eee;">
<div class="homePage " style="margin: 0;border: 0;border-right: 5px solid #eee;">
<!-- 数据展示-->
<div class="lbt" v-if="showList.length>0" >
<el-carousel height='290px' >
<el-carousel-item v-for="(item,index) in showList" :key="item.id+index">
<!-- 轮播图all-->
<div class="lbtAll">
<!-- 说明-->
<div class="sm">
<el-tooltip :content="`${item.gsName}${item.bzName||''}:${item.wzr}:${item.wzxw}`" placement="top">
<span class='infor' >
{{`${item.gsName}${item.bzName||''}的${item.wzr}做出违章行为:${item.wzxw}`}}
</span>
</el-tooltip>
</div>
<el-image
style="width: 100%; height: 100%"
:src=" `${baseurl}/api/file/${item.filePath}`"
fit="fit"></el-image>
</div>
</el-carousel-item>
</el-carousel>
</div>
<div style="height: 300px;display: flex;align-items: center;justify-content: center;position: relative;" class="lbt" v-else >
<span style="position: absolute;bottom: 50px;line-height: 40px;font-size: 18px;font-weight: 800;color:#787878" >本月暂无违规记录。</span>
<img style="height:150px;width: 200px;" :src="aqpng" alt="" srcset="">
</div>
<!-- 轮播图-->
</div>
<div class="homePage " style="margin: 0;border: 0;border-right: 5px solid #eee;">
<!-- 数据展示-->
<div class="lbt" v-if="showListRy.length>0" >
<el-carousel height='290px' >
<el-carousel-item v-for="(item,index) in showListRy" :key="item.id+index">
<!-- 轮播图all-->
<div class="lbtAll">
<!-- 说明-->
<div class="sm">
<el-tooltip :content="`${item.gsName}${item.userName||''}:${item.bytitle}:${item.bycont}`" placement="top">
<span class='infor' >
{{`${item.gsName}${item.bzName||''}的${item.userName}:${item.bytitle}`}}
</span>
</el-tooltip>
</div>
<el-image
style="width: 100%; height: 100%"
:src=" `${baseurl}/api/file/${item.filePath}`"
fit="fit"></el-image>
</div>
</el-carousel-item>
</el-carousel>
</div>
<div style="height: 300px;display: flex;align-items: center;justify-content: center;position: relative;" class="lbt" v-else >
<span style="position: absolute;bottom: 50px;line-height: 40px;font-size: 18px;font-weight: 800;color:#787878" >本月暂无荣誉记录。</span>
<img style="height:150px;width: 200px;" :src="ryqno" alt="" srcset="">
</div>
<!-- 轮播图-->
</div>
<div class="top_right" >
<div class="top_right_fxpc">
<div class="zttitle">
风险排查率
</div>
<div class="ztcxxx">
<div class="search-item" style="padding-left: 20px;border-bottom: 2px solid #eee;">
<el-radio v-model="queryParams1.rwlx" label="D">日任务</el-radio>
<el-radio v-model="queryParams1.rwlx" label="W">周任务</el-radio>
<el-radio v-model="queryParams1.rwlx" label="M">月任务</el-radio>
</div>
</div>
<!-- 图表-->
<div id="fxpcChart" class="chart" >
</div>
</div>
<div class="top_right_yhhz">
<div class="zttitle" style="border-right: 0px;">
隐患处理完成率
</div>
<div class="ztcxxx" style="padding-left: 0px;" >
<div class="search-item" style="border-bottom: 2px solid #eee;padding-left: 10px;" >
<RelSelect style="width: 200px;margin-right: 10px;" hasValue src='jcsj/common/bm/queryGs' filterable :match="{value:'id',label:'bmmc'}" v-model='queryParams1.gsid' ></RelSelect>
<!-- <el-radio v-model="queryParams2.hzfs" label="GS">按公司</el-radio>
<el-radio v-model="queryParams2.hzfs" label="BM">按班组</el-radio>
<el-radio v-model="queryParams2.hzfs" label="RY">按人员</el-radio> -->
</div>
</div>
<div id="yhclChart" class="chart" >
</div>
</div>
</div>
<!-- 隐患率-->
<!-- 风险率-->
</div>
<div class="bottom">
<div class="zttitle">
未处理隐患
</div>
<div class="" style="height: calc(100% - 30px);width: 100%;">
<TablePager isAutoRoll showPagination queryAll :delButton='false' @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div>
</div>
</template>
<script>
const baseurl=process.env.VUE_APP_BASE_API
import {
tableMixin
} from 'common'
import vueSeamlessScroll from 'vue-seamless-scroll'
import * as echarts from 'echarts';
import aqpng from '@/assets/images/aq.png'
import {
doQuery as doQueryfx
} from "@/api/riskPrecontrol/riskAnalysis.js";
import {
queryYhsbtj as doQueryyh
} from "@/api/dangerManagement/yhslhz.js";
import {
doQuery as doQueryDcl
} from "@/api/dangerManagement/enterSafetyRecords.js"
import {
queryBglxFile
} from '@/api/threeViolations/enterTV.js';
import {
doQueryWithFile
} from '@/api/basicData/ryq.js';
import ryqno from '@/assets/images/ryqno.png'
export default{
components: {
vueSeamlessScroll
},
mixins: [tableMixin],
computed:{
gsid(){
return this.queryParams1.gsid
},
radio1(){
let val=this.queryParams1.rwlx
return val
},
// radio2(){
// let val=this.queryParams2.hzfs
// return val
// }
},
watch:{
gsid(val){
/* 监听公司id*/
if(val){
this.queryParams2.gsid= this.queryParams1.gsid
this.doQueryfx()
this.doQueryyh()
}
},
radio1(val){
this.doQueryfx()
},
// radio2(){
// this.doQueryyh()
// }
},
activated() {
console.log('activated')
this.$refs['TablePager'].pageQuery()
},
mounted(){
// this.$refs['TablePager'].pageQuery()
this.fxpcChart=echarts.init(document.getElementById('fxpcChart'))
this.yhclChart=echarts.init(document.getElementById('yhclChart'))
this.$nextTick(()=>{
// this.setChart(this.yhclChart,{
// name:'隐患整改完成率',
// title:'隐患整改'
// })
})
doQueryWithFile({}).then(res=>{
this.showListRy=res.data.records||[]
})
queryBglxFile({}).then(res=>{
this.showList=res.data.records||[]
// this.showList=[]
})
},
data(){
return{
showListRy:[],
tableTitle: [
{label: "状态", prop: "ztName", fieldType: "ftString",width:60},
{label: "公司", prop: "gsid", fieldType: "ftString",width:192,transform:{
url:'jcsj/common/bm/queryGs',label:'bmmc',value:'id'
}},
{label: "班组", prop: "bmid", fieldType: "ftString",width:192,transform:{
url:'jcsj/common/bm/queryBz',label:'bmmc',value:'id'
}},
//
// {label: "状态", prop: "zt", fieldType: "ftString",transform:{
// url:'aqgl/yhgl/yhjl/init/zt',label:'name',value:'id'
// }},
// {label: "整改说明", prop: "clff", fieldType: "ftString",width:300},
// {label: "整改完成时间", prop: "clsj", fieldType: "ftDateTime"},
{label: "发现日期", prop: "fxrq", fieldType: "ftDateTime"},
/* */
{label: "整改日期", prop: "clsj", fieldType: "ftDateTime"},
{label: "复查日期", prop: "fcsj", fieldType: "ftDateTime"},
/* */
{label: "风险点", prop: "fxdName", fieldType: "ftString",width:300},
{label: "隐患地点", prop: "yhdd", fieldType: "ftString",width:300},
{label: "隐患类型", prop: "flid", fieldType: "ftString",width:192,transform:{
url:'aqgl/yhgl/yhfl/query',label:'name',value:'id'
}},
{label: "隐患等级", prop: "dj", fieldType: "ftString",width:192,transform:{
url:'aqgl/fxyk/fxpc/init/wxdj',label:'name',value:'id'
}},
{label: "内容", prop: "nr", fieldType: "ftString",width:300},
// {label: "责任部门", prop: "bmName", fieldType: "ftString",width:192},
// {label: "制定整改方案", prop: "zdzgfa", fieldType: "ftString",width:6},
{label: "责任人", prop: "zrrName", fieldType: "ftString",width:192},
{label: "整改方案", prop: "zgfa", fieldType: "ftString",width:300},
{label: "管控措施", prop: "gkcs", fieldType: "ftString",width:300},
{label: "要求整改完成时间", prop: "yqzgsj", fieldType: "ftDateTime"},
// {label: "隐患分类", prop: "flid", fieldType: "ftString",width:192},
{label: "处理人", prop: "clrName", fieldType: "ftString",width:192},
// {label: "处理时间", prop: "clsj", fieldType: "ftDateTime"},
// {label: "处理方法", prop: "clff", fieldType: "ftString",width:300},
{label: "复查人", prop: "fcrName", fieldType: "ftString",width:192},
{label: "上报人", prop: "sbrName", fieldType: "ftString",width:192},
/* 检查人 */
// {label: "复查时间", prop: "fcsj", fieldType: "ftDateTime"},
// {label: "复查结果", prop: "fcjg", fieldType: "ftString",width:300},
// {label: "处置人", prop: "czr", fieldType: "ftString",width:192},
// {label: "处置时间", prop: "czsj", fieldType: "ftDateTime"},
// {label: "处置意见", prop: "czyj", fieldType: "ftString",width:300},
// {label: "状态", prop: "zt", fieldType: "ftString",width:6},
// {label: "附件数", prop: "attachcount", fieldType: "int"},
{label: "备注", prop: "bz", fieldType: "ftString",width:300},
// {label: "工作流状态", prop: "wfpname", fieldType: "ftString",width:300},
{label: "维护人", prop: "whr", fieldType: "ftString"},
{label: "维护时间", prop: "whsj", fieldType: "ftDateTime"},
// {label: "创建人", prop: "cjr", fieldType: "ftString"},
// {label: "创建时间", prop: "cjsj", fieldType: "ftDateTime"},
],
queryParams1:{
grouptype:'GS',
rwlx:'D',
gsid:'',
// ksrq:new Date(new Date().setHours(0, 0, 0, 0)).getTime(),
// jsrq:new Date(new Date().setHours(23,59,59,999)).getTime()
ksrq:new Date().getTime(),
jsrq:new Date().getTime()
},
queryParams2:{
hzfs:'GS',
gsid:'',
ksrq:null,
jsrq:new Date().getTime()
// jsrq:new Date(new Date().setHours(23,59,59,999)).getTime()
},
queryParams:{
queryType:'YHWCL'
// zt:'S'
},
ryqno:ryqno,
aqpng:aqpng,
baseurl:baseurl,
showList:[],
/* dom*/
fxpcChart:null,
yhclChart:null,
}
},
methods:{
query:doQueryDcl,
doQueryfx(){
if(this.queryParams1.rwlx=='W'){
this.queryParams1.ksrq=new Date(new Date(this.getFirstWeek()).Format('yyyy/MM/dd')+" 00:00:00").getTime();
this.queryParams1.jsrq=new Date(new Date(this.getlastWeek()).Format('yyyy/MM/dd')+" 23:59:59").getTime();
}else if(this.queryParams1.rwlx=='D'){
this.queryParams1.ksrq=new Date().getTime();
this.queryParams1.jsrq=new Date().getTime();
}else{
const today = new Date();
today.setDate(1);
today.setHours(0, 0, 0, 0);
const timestamp = today.getTime();
this.queryParams1.ksrq=timestamp;
this.queryParams1.jsrq=new Date().getTime();
}
doQueryfx(this.queryParams1).then(res=>{
if(res.success){
let value
if(res.data.records[0]){
value=res.data.records[0].wcPercent||0
}else{
value=0
}
this.setChart(this.fxpcChart,{
name:'风险排查率',
title:'风险排查',
value:value
})
}
})
},
getFirstWeek(){
let nowDate = new Date();
let first = nowDate.getDate() - nowDate.getDay()+1;//getDate()从nowDate对象返回一个月中的某一天;getDay()从nowDate对象返回一周中的某一天
let firstDate = new Date(nowDate.setDate(first)).toUTCString();//setDate()设置nowDate对象中月的某一天;toUTCString()根据世界时,把nowDate对象转换为字符串。
console.log(firstDate);
return firstDate;
},
getlastWeek(){
let nowDate = new Date();
let first = nowDate.getDate() - nowDate.getDay()+1;
let last = first + 6; // last day is the first day + 6
let lastday = new Date(nowDate.setDate(last)).toUTCString();
return lastday
},
doQueryyh(){
doQueryyh(this.queryParams2).then(res=>{
if(res.success){
let value
if(res.data.records[0]){
let data1=res.data.records[0]?res.data.records[0].wclCount:0;
let data2=res.data.records[0]?res.data.records[0].yclCount:0;
value=Number(parseFloat(data2/(data1+data2)).toFixed(4))*100;
// value=res.data.records[0].wcPercent||0
}else{
value=0
}
this.setChart(this.yhclChart,{
name:'隐患整改完成率',
title:'隐患整改',
value:value
})
}
})
},
/* 渲染仪表盘*/
setChart(chartDom,setting){
/* 基础配置*/
let option = {
tooltip: {
formatter: '{a} <br/>{b} : {c}%'
},
series: [
{
axisLine: {
lineStyle: {
width: 6,
color: [
[0.25, '#FF6E76'],
[0.5, '#FDDD60'],
[0.75, '#58D9F9'],
[1, '#7CFFB2']
]
}},
radius:'90%',
name:setting.title,
type: 'gauge',
center: ["50%", "50%"], // 仪表盘位置(圆心坐标)
progress: {
show: true
},
title:{
show:false
},
detail: {
valueAnimation: true,
formatter: '{value}',
textStyle:{
fontSize:17
}
},
data: [
{
value: setting.value,
name: setting.name
}
]
}
]
}
/* 渲染dom*/
chartDom.setOption(option)
}
}
}
</script>
<style lang="scss" scope>
.listf{
float: right;
}
.zttitle{
border-right: 2px solid #eee;
border-bottom: 2px solid #eee;
line-height: 30px;
font-size: 16px;
font-weight: 700;
color: #777;
width: 100%;
// padding-left: 30px;
text-align: center;
}
.ztcxxx{
height: 60px;
width: 100%;
}
.chart{
width: 100%;
height: calc(300px - 60px - 30px);
}
.top{
height:300px;
width:100%;
display: flex;
.top_right{
flex: 1;
// background-color: #eee;
display: flex;
/* fxpc*/
.top_right_fxpc{
flex:1
}
.top_right_yhhz{
flex:1
}
}
}
.bottom{
flex: 1;
border-bottom: 5px solid #eee;
border-left: 5px solid #eee;
border-right: 5px solid #eee;
}
.homePage{
width: 35%;
height: 100%;
}
.nodata{
background-image: url('/src/assets/image/aq.svg');
}
.lbt{
height: 100%;
width: 100%;
.lbtAll{
height: 100%;
width: 100%;
.sm{
padding-top: 16px;
padding-bottom: 26px;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
height:70px;
width:100%;
background-color: rgba(0,0,0,0.7);
z-index: 999;
bottom:0;
overflow: hidden;
text-overflow: ellipsis;
.infor{
color: #fff;
line-height: 25px;
font-size: 12px;
}
}
}
}
.el-carousel__item:nth-child(2n) {
background-color: #99a9bf;
}
.el-carousel__item:nth-child(2n+1) {
background-color: #d3dce6;
}
</style>
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