fix: 对接工程概况接口
This commit is contained in:
parent
45a0b6ff6f
commit
121a359419
@ -3,9 +3,9 @@ NODE_ENV = 'development'
|
||||
|
||||
# 本地环境接口地址(/api/index.ts文件中使用)
|
||||
# VITE_API_URL = 'http://121.196.214.246/api'
|
||||
VITE_API_URL = 'http://182.90.224.147:100'
|
||||
# VITE_API_URL = 'http://jxj.zhgdyun.com:100'
|
||||
# VITE_API_URL = 'http://192.168.34.221:12360'
|
||||
# VITE_API_URL = 'http://192.168.34.221:30002'
|
||||
VITE_API_URL = 'http://192.168.34.221:30002'
|
||||
|
||||
|
||||
# 上传
|
||||
|
||||
@ -11,3 +11,33 @@ export const getProjectDetail = (params: {}) => {
|
||||
export const getWorkerStatisticsCountApi = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/workerInfo/getWorkerStatisticsCount`, params);
|
||||
};
|
||||
|
||||
// 安全管理
|
||||
export const getProjectInspectRecordCountApi = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/hiddenDangerInspectRecord/getProjectInspectRecordCount`, params);
|
||||
};
|
||||
|
||||
// 质量管理
|
||||
export const selectQualityStatisticsApi = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/qualityInspectionRecord/selectQualityStatistics`, params);
|
||||
};
|
||||
|
||||
//环境监测
|
||||
export const getCurrentDayAirQualityApi = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/airQualityAnalysis/getCurrentDayAirQuality`, params);
|
||||
};
|
||||
|
||||
//编辑项目信息 (此模块用来编辑更换项目宣传视频)
|
||||
export const editProjectInfo = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/project/edit`, params);
|
||||
};
|
||||
|
||||
// 保存效果图
|
||||
export const eidtProjectShowConfig = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/projectShowConfig/eidtProjectShowConfig`, params);
|
||||
};
|
||||
|
||||
// 查询效果图
|
||||
export const queryBySnData = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/projectShowConfig/queryBySn`, params);
|
||||
};
|
||||
|
||||
@ -1,3 +1,18 @@
|
||||
// 智慧党建接口API
|
||||
import http from "@/api";
|
||||
const BASEURL = import.meta.env.VITE_API_URL;
|
||||
|
||||
// 获取左中政治面貌圆环图
|
||||
export const getPoliticalOutlook = (params: {}) => {
|
||||
return http.post(BASEURL + `/xmgl/partyMemberManage/countPartyMemberManagePoliticalStatus`, params);
|
||||
};
|
||||
|
||||
// 获取左上学习强国
|
||||
export const partyMemberLearn = (params: {}) => {
|
||||
return http.get(BASEURL + `/xmgl/partyMemberLearnStrongCountry/page`, params);
|
||||
};
|
||||
|
||||
// 宣传视频列表
|
||||
export const getPartyVideo = (params: {}) => {
|
||||
return http.get(BASEURL + `/xmgl/partyPromotionalVideo/page`, params);
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="leftTop" v-if="projectData">
|
||||
<div class="leftTop">
|
||||
<Card title="进度概况">
|
||||
<div class="progressContent">
|
||||
<div style="display: flex; padding: 2% 1%; color: #fff; font-size: 16px">
|
||||
@ -9,7 +9,8 @@
|
||||
<div class="totalDay">
|
||||
<div style="line-height: 45px">
|
||||
项目总天数
|
||||
<span class="dayImg" v-for="item in projectData.totalProjectDay" :key="item">{{ item }}</span>
|
||||
<span v-if="!projectData.totalProjectDay" class="dayImg">0</span>
|
||||
<span v-else class="dayImg" v-for="item in projectData.totalProjectDay" :key="item">{{ item }}</span>
|
||||
<!-- <span class="dayImg">0</span>
|
||||
<span class="dayImg">4</span>
|
||||
<span class="dayImg">7</span> -->
|
||||
@ -19,7 +20,8 @@
|
||||
<div class="residueDay">
|
||||
<div style="line-height: 45px">
|
||||
项目剩余天数
|
||||
<span class="dayImg" v-for="item in projectData.surplusDay" :key="item">{{ item }}</span>
|
||||
<span v-if="!projectData.surplusDay" class="dayImg">0</span>
|
||||
<span v-else class="dayImg" v-for="item in projectData.surplusDay" :key="item">{{ item }}</span>
|
||||
<!-- <span class="dayImg">2</span>
|
||||
<span class="dayImg">8</span>
|
||||
<span class="dayImg">6</span> -->
|
||||
@ -101,10 +103,10 @@ type Props = {
|
||||
};
|
||||
// withDefaults 定义默认值(传入的数据类型同默认值)
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
projectData: null
|
||||
projectData: {}
|
||||
});
|
||||
// 项目信息
|
||||
const projectData = ref(null as any);
|
||||
const projectData = ref({} as any);
|
||||
|
||||
watch(
|
||||
() => props.projectData,
|
||||
@ -114,7 +116,7 @@ watch(
|
||||
// props.xData = newVal;
|
||||
projectData.value = newVal;
|
||||
// console.log("当前阶段", projectData.value.constructionStage);
|
||||
progressList.value[projectData.value.constructionStage].status = 1;
|
||||
progressList.value[projectData.value.constructionStage - 1].status = 1;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@ -1,9 +1,47 @@
|
||||
<template>
|
||||
<div class="leftTop" v-if="projectData">
|
||||
<Card title="宣传视频">
|
||||
<div class="videoBox">
|
||||
<div class="leftTop">
|
||||
<Card title="项目展示">
|
||||
<div class="top-tab">
|
||||
<div
|
||||
class="tab-box"
|
||||
:style="boxStyle(item)"
|
||||
v-for="(item, index) in topText"
|
||||
:key="item.id"
|
||||
@click="activeBtn(item, index)"
|
||||
>
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="videoBox" v-if="showVideo" @mouseenter="showChangeVideo = true" @mouseleave="showChangeVideo = false">
|
||||
<el-upload
|
||||
:action="BASEURL + '/upload/image'"
|
||||
:on-success="file => handleSuccessTwo(file, 1)"
|
||||
:on-error="file => handleError(file, 1)"
|
||||
:beforeUpload="file => handleBeforeUpload(file, 1)"
|
||||
name="files"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<!-- 更换视频 -->
|
||||
<span class="change-video" v-if="showChangeVideo">更换视频</span>
|
||||
</el-upload>
|
||||
<video :src="BASEURL + '/image/' + projectData.videoUrl" class="videos" autoplay controls loop></video>
|
||||
</div>
|
||||
<div class="imgBox" v-else>
|
||||
<div class="imgs" @mouseenter="showChangeImg = true" @mouseleave="showChangeImg = false">
|
||||
<el-upload
|
||||
:action="BASEURL + '/upload/image'"
|
||||
:on-success="file => handleSuccess(file, 1)"
|
||||
:on-error="file => handleError(file, 1)"
|
||||
:beforeUpload="file => handleBeforeUpload(file, 1)"
|
||||
name="files"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<!-- 更换图片 -->
|
||||
<span class="change-video" v-if="showChangeImg">更换图片</span>
|
||||
</el-upload>
|
||||
<img :src="BASEURL + '/image/' + picUrl" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
@ -11,16 +49,22 @@
|
||||
<script setup lang="ts">
|
||||
import Card from "@/components/card.vue";
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { GlobalStore } from "@/stores";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
import { editProjectInfo, eidtProjectShowConfig, queryBySnData } from "@/api/modules/projectOverview";
|
||||
|
||||
const store = GlobalStore();
|
||||
// ts
|
||||
type Props = {
|
||||
projectData?: any; // 传入项目信息
|
||||
};
|
||||
// withDefaults 定义默认值(传入的数据类型同默认值)
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
projectData: null
|
||||
projectData: {}
|
||||
});
|
||||
// 项目信息
|
||||
const projectData = ref(null as any);
|
||||
const projectData = ref({} as any);
|
||||
|
||||
watch(
|
||||
() => props.projectData,
|
||||
@ -32,25 +76,217 @@ watch(
|
||||
}
|
||||
}
|
||||
);
|
||||
//效果图
|
||||
const picUrl = ref("" as any);
|
||||
|
||||
const BASEURL = import.meta.env.VITE_API_URL;
|
||||
// 显示视频
|
||||
const showVideo = ref(true as any);
|
||||
|
||||
// 显示更换图片
|
||||
const showChangeImg = ref(false as any);
|
||||
|
||||
// 显示更换视频
|
||||
const showChangeVideo = ref(false as any);
|
||||
|
||||
let topText = ref([
|
||||
{ id: 1, title: "宣传视频", isActive: true },
|
||||
{ id: 2, title: "效果图", isActive: false }
|
||||
]);
|
||||
|
||||
function boxStyle(item: any) {
|
||||
if (item.isActive) {
|
||||
let choiseStyle = {
|
||||
color: "#fff"
|
||||
};
|
||||
return choiseStyle;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
let tabIndex = ref(1 as any);
|
||||
function activeBtn(item: any) {
|
||||
let currentState = item.isActive;
|
||||
if (!currentState) {
|
||||
topText.value.forEach(el => {
|
||||
el.isActive = false;
|
||||
});
|
||||
item.isActive = !currentState;
|
||||
tabIndex.value = item.id;
|
||||
}
|
||||
if (item.id === 1) {
|
||||
showVideo.value = true;
|
||||
} else {
|
||||
showVideo.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const uploadFail = () => {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传失败,请重试",
|
||||
type: "warning"
|
||||
});
|
||||
};
|
||||
|
||||
const fileTypeFail = () => {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "请选择正确的文件",
|
||||
type: "warning"
|
||||
});
|
||||
};
|
||||
|
||||
const uploadSuccess = () => {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传成功",
|
||||
type: "success"
|
||||
});
|
||||
};
|
||||
|
||||
// 文件上传 之前
|
||||
function handleBeforeUpload(file, type) {
|
||||
console.log(file, "上传之前");
|
||||
let fileType = file.type.split("/")[0];
|
||||
if (fileType == "video" || fileType == "image") {
|
||||
return true;
|
||||
} else {
|
||||
fileTypeFail(); //"请选择正确的文件"
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//上传失败
|
||||
function handleError(file: any) {
|
||||
console.log(file, "上传失败");
|
||||
uploadFail(); //"上传失败,请重试"
|
||||
}
|
||||
// 效果图上传成功
|
||||
function handleSuccess(file: any) {
|
||||
console.log("效果图上传成功", file);
|
||||
if (file.code == 200 || file.status == "SUCCESS") {
|
||||
console.log(file);
|
||||
let url = file.data[0].imageUrl;
|
||||
saveEffectData(url);
|
||||
}
|
||||
}
|
||||
|
||||
// 视频上传成功
|
||||
function handleSuccessTwo(file: any) {
|
||||
if (file.code == 200 || file.status == "SUCCESS") {
|
||||
console.log(file, "上传成功");
|
||||
let url = file.data[0].imageUrl;
|
||||
// this.imgUrl = url;
|
||||
saveOrDeleteVideo(url);
|
||||
}
|
||||
}
|
||||
//效果图 保存
|
||||
function saveEffectData(url: any) {
|
||||
// let configValue = JSON.stringify(url);
|
||||
let data = {
|
||||
projectSn: store.sn,
|
||||
showType: 3,
|
||||
showTitle: "效果图", //'效果图'
|
||||
configValue: url
|
||||
};
|
||||
eidtProjectShowConfig(data).then((res: any) => {
|
||||
if (res.code == 200) {
|
||||
getQueryBySnData();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 查询效果图
|
||||
function getQueryBySnData() {
|
||||
queryBySnData({
|
||||
projectSn: store.sn,
|
||||
showType: 3
|
||||
}).then((res: any) => {
|
||||
console.log(res, "效果图");
|
||||
picUrl.value = res.result.configValue;
|
||||
});
|
||||
}
|
||||
// //保存或删除宣传视频
|
||||
function saveOrDeleteVideo(url) {
|
||||
editProjectInfo({
|
||||
projectSn: store.sn,
|
||||
videoUrl: url
|
||||
}).then(res => {
|
||||
console.log("保存成功", res);
|
||||
uploadSuccess(); //"上传成功"
|
||||
projectData.value.videoUrl = url;
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getQueryBySnData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.leftTop {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
.videoBox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
height: 92%;
|
||||
margin-top: 8%;
|
||||
background: url("@/assets/images/comprehensiveManage/project10.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.videos {
|
||||
width: 78%;
|
||||
height: 90%;
|
||||
margin-left: 11%;
|
||||
margin-top: 1%;
|
||||
}
|
||||
}
|
||||
.imgBox {
|
||||
width: 100%;
|
||||
height: 92%;
|
||||
margin-top: 8%;
|
||||
background: url("@/assets/images/comprehensiveManage/project10.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.imgs {
|
||||
width: 78%;
|
||||
height: 92%;
|
||||
margin: 3% 11%;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-top: 1%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.change-video {
|
||||
position: absolute;
|
||||
background: url("@/assets/images/cardImg.png") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
color: #fff;
|
||||
padding: 1% 2%;
|
||||
font-size: 16px;
|
||||
left: 45%;
|
||||
top: 55%;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.top-tab {
|
||||
position: absolute;
|
||||
top: 12%;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0 30%;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
.tab-box {
|
||||
font-size: 16px;
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .h-card .content {
|
||||
background: none;
|
||||
}
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="leftTop" v-if="statisticsCount">
|
||||
<div class="leftTop">
|
||||
<Card title="智能设备">
|
||||
<div class="deviceData">
|
||||
<div class="deviceDataA">
|
||||
<div class="num">
|
||||
<i>{{ statisticsCount.devcount.ufaceDevNum }}</i>
|
||||
<i>{{ statisticsCount.devcount.ufaceDevNum || 0 }}</i>
|
||||
</div>
|
||||
<div class="text">实名制设备数</div>
|
||||
</div>
|
||||
<div class="deviceDataB">
|
||||
<div class="num">
|
||||
<i>{{ statisticsCount.devcount.environmentDevNum }}</i>
|
||||
<i>{{ statisticsCount.devcount.environmentDevNum || 0 }}</i>
|
||||
</div>
|
||||
<div class="text">环境设备数</div>
|
||||
</div>
|
||||
@ -28,10 +28,14 @@ type Props = {
|
||||
};
|
||||
// withDefaults 定义默认值(传入的数据类型同默认值)
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
statisticsCount: null
|
||||
statisticsCount: {
|
||||
devcount: {}
|
||||
}
|
||||
});
|
||||
// 人员概况数据
|
||||
const statisticsCount = ref(null as any);
|
||||
const statisticsCount = ref({
|
||||
devcount: {}
|
||||
} as any);
|
||||
|
||||
watch(
|
||||
() => props.statisticsCount,
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<div class="leftTop" v-if="statisticsCount">
|
||||
<div class="leftTop">
|
||||
<Card title="人员概况">
|
||||
<div class="topPeopleNum">
|
||||
<div class="dataTlo">
|
||||
<div class="text"><i>实名制人数</i></div>
|
||||
<div class="num">
|
||||
<i>{{ statisticsCount.workercount.totalPerson }}</i>
|
||||
<i>{{ statisticsCount.workercount.totalPerson || 0 }}</i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dataTlt">
|
||||
<div class="text"><i>在场人数</i></div>
|
||||
<div class="num">
|
||||
<i>{{ statisticsCount.presencecount.lwPersonTotal }}</i>
|
||||
<i>{{ statisticsCount.presencecount.lwPersonTotal || 0 }}</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -29,7 +29,9 @@
|
||||
<div class="text"><i>甲方人员</i></div>
|
||||
<div class="num">
|
||||
<i style="color: #eea959"
|
||||
>{{ statisticsCount.presencecount.jfGlPersonTotal }}/{{ statisticsCount.workercount.jfGlPersonTotal }}</i
|
||||
>{{ statisticsCount.presencecount.jfGlPersonTotal || 0 }}/{{
|
||||
statisticsCount.workercount.jfGlPersonTotal || 0
|
||||
}}</i
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@ -37,7 +39,9 @@
|
||||
<div class="text"><i>监理人员</i></div>
|
||||
<div class="num">
|
||||
<i style="color: #82fbea"
|
||||
>{{ statisticsCount.presencecount.jlGlPersonTotal }}/{{ statisticsCount.workercount.jlGlPersonTotal }}</i
|
||||
>{{ statisticsCount.presencecount.jlGlPersonTotal || 0 }}/{{
|
||||
statisticsCount.workercount.jlGlPersonTotal || 0
|
||||
}}</i
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@ -45,7 +49,9 @@
|
||||
<div class="text"><i>乙方人员</i></div>
|
||||
<div class="num">
|
||||
<i style="color: #7aa0ea"
|
||||
>{{ statisticsCount.presencecount.yfGlPersonTotal }}/{{ statisticsCount.workercount.yfGlPersonTotal }}</i
|
||||
>{{ statisticsCount.presencecount.yfGlPersonTotal || 0 }}/{{
|
||||
statisticsCount.workercount.yfGlPersonTotal || 0
|
||||
}}</i
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
@ -66,10 +72,13 @@ type Props = {
|
||||
};
|
||||
// withDefaults 定义默认值(传入的数据类型同默认值)
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
statisticsCount: null
|
||||
statisticsCount: {}
|
||||
});
|
||||
// 人员概况数据
|
||||
const statisticsCount = ref(null as any);
|
||||
const statisticsCount = ref({
|
||||
workercount: {},
|
||||
presencecount: {}
|
||||
} as any);
|
||||
|
||||
watch(
|
||||
() => props.statisticsCount,
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="leftTop">
|
||||
<Card title="项目信息">
|
||||
<div class="projectInfo" v-if="projectData">
|
||||
<div><span>项目名称:</span> {{ projectData.projectName }}</div>
|
||||
<div class="projectInfo">
|
||||
<div><span>项目名称:</span> {{ projectData.projectName || "" }}</div>
|
||||
<div>
|
||||
<span>项目地址:</span> {{ projectData.provinceName }}{{ projectData.cityName }} {{ projectData.areaName
|
||||
}}{{ projectData.projectAddress }}
|
||||
<span>项目地址:</span> {{ projectData.provinceName || "" }}{{ projectData.cityName || "" }}
|
||||
{{ projectData.areaName || "" }}{{ projectData.projectAddress || "" }}
|
||||
</div>
|
||||
<div><span>项目经理:</span> {{ projectData.projectManage }}</div>
|
||||
<div><span>联系电话:</span> {{ projectData.projectTel }}</div>
|
||||
<div><span>建筑面积:</span> {{ projectData.projectAcreage }} ㎡</div>
|
||||
<div><span>开工日期:</span> {{ projectData.startWorkDate }}</div>
|
||||
<div><span>项目经理:</span> {{ projectData.projectManage || "" }}</div>
|
||||
<div><span>联系电话:</span> {{ projectData.projectTel || "" }}</div>
|
||||
<div><span>建筑面积:</span> {{ projectData.projectAcreage || "" }} ㎡</div>
|
||||
<div><span>开工日期:</span> {{ projectData.startWorkDate || "" }}</div>
|
||||
<div><span>工程类别:</span> {{ projectData.projectType ? projectTypeEnum[projectData.projectType - 1].name : "" }}</div>
|
||||
</div>
|
||||
</Card>
|
||||
@ -28,10 +28,10 @@ type Props = {
|
||||
};
|
||||
// withDefaults 定义默认值(传入的数据类型同默认值)
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
projectData: null
|
||||
projectData: {}
|
||||
});
|
||||
// 项目信息
|
||||
const projectData = ref(null as any);
|
||||
const projectData = ref({} as any);
|
||||
|
||||
watch(
|
||||
() => props.projectData,
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { GlobalStore } from "@/stores";
|
||||
import { getCurrentDayAirQualityApi } from "@/api/modules/headNoise";
|
||||
import { getCurrentDayAirQualityApi } from "@/api/modules/projectOverview";
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import * as echarts from "echarts";
|
||||
import Card from "@/components/card.vue";
|
||||
@ -439,13 +439,11 @@ const getList = async () => {
|
||||
if (res.result) {
|
||||
analysisData.value = res.result.analysisData;
|
||||
}
|
||||
console.log("analysisData", analysisData.value);
|
||||
drawChart();
|
||||
};
|
||||
onMounted(() => {
|
||||
// getList();
|
||||
drawChart();
|
||||
|
||||
getList();
|
||||
// drawChart();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,18 +1,20 @@
|
||||
<template>
|
||||
<div class="leftTop">
|
||||
<Card title="质量管理">
|
||||
|
||||
<div id="echartsQuity" style="width: 100%; height: 100%"></div>
|
||||
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Card from "@/components/card.vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { GlobalStore } from "@/stores";
|
||||
const store = GlobalStore();
|
||||
import * as echarts from "echarts";
|
||||
import { selectQualityStatisticsApi } from "@/api/modules/projectOverview";
|
||||
|
||||
let questionTotal = ref(0 as any);
|
||||
let dataList = ref([
|
||||
{
|
||||
value: 30,
|
||||
@ -36,8 +38,7 @@ let dataList = ref([
|
||||
borderWidth: 20
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
]);
|
||||
function Pie() {
|
||||
let dataArr = [];
|
||||
@ -82,23 +83,24 @@ function drawEchart() {
|
||||
trigger: "item"
|
||||
},
|
||||
title: {
|
||||
text: 24,
|
||||
text: questionTotal.value,
|
||||
subtext: "安全问题数",
|
||||
x: "19%",
|
||||
x: "24%",
|
||||
y: "center",
|
||||
textAlign: "center",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
fontSize: 26,
|
||||
fontWeight: "normal",
|
||||
align: "center",
|
||||
width: "200px",
|
||||
// align: "center",
|
||||
// width: "200px",
|
||||
fontFamily: "sadigitalNumber"
|
||||
},
|
||||
subtextStyle: {
|
||||
color: "#ccc",
|
||||
fontSize: 12,
|
||||
fontWeight: "normal",
|
||||
align: "center",
|
||||
fontWeight: "normal"
|
||||
// align: "center",
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
@ -282,6 +284,19 @@ function drawEchart() {
|
||||
};
|
||||
echartsTest.setOption(option, true);
|
||||
}
|
||||
//获取质量管理
|
||||
// const safeData = ref(null as any);
|
||||
const qualityInfo = async () => {
|
||||
const res: any = await selectQualityStatisticsApi({ projectSn: store.sn });
|
||||
dataList.value[0].value = res.result.total.rectificationNum;
|
||||
dataList.value[1].value = res.result.total.totalNum - res.result.total.rectificationNum;
|
||||
questionTotal.value = res.result.total.totalNum;
|
||||
drawEchart();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
qualityInfo();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@ -1,18 +1,21 @@
|
||||
<template>
|
||||
<div class="leftTop">
|
||||
<Card title="安全管理">
|
||||
|
||||
<div id="echartsSafe" style="width: 100%; height: 100%"></div>
|
||||
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Card from "@/components/card.vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { GlobalStore } from "@/stores";
|
||||
const store = GlobalStore();
|
||||
import { getProjectInspectRecordCountApi } from "@/api/modules/projectOverview";
|
||||
import * as echarts from "echarts";
|
||||
|
||||
let questionTotal = ref(0 as any);
|
||||
|
||||
let dataList = ref([
|
||||
{
|
||||
value: 30,
|
||||
@ -36,8 +39,7 @@ let dataList = ref([
|
||||
borderWidth: 20
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
]);
|
||||
function Pie() {
|
||||
let dataArr = [];
|
||||
@ -71,10 +73,6 @@ function Pie() {
|
||||
return dataArr;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
drawEchart();
|
||||
});
|
||||
|
||||
function drawEchart() {
|
||||
let echartsTest = echarts.init(document.getElementById("echartsSafe"));
|
||||
let option = {
|
||||
@ -82,23 +80,23 @@ function drawEchart() {
|
||||
trigger: "item"
|
||||
},
|
||||
title: {
|
||||
text: 24,
|
||||
text: questionTotal.value,
|
||||
subtext: "安全问题数",
|
||||
x: "19%",
|
||||
x: "24%",
|
||||
y: "center",
|
||||
textAlign: "center",
|
||||
textStyle: {
|
||||
color: "#fff",
|
||||
fontSize: 26,
|
||||
fontWeight: "normal",
|
||||
align: "center",
|
||||
width: "200px",
|
||||
// align: "center",
|
||||
fontFamily: "sadigitalNumber"
|
||||
},
|
||||
subtextStyle: {
|
||||
color: "#ccc",
|
||||
fontSize: 12,
|
||||
fontWeight: "normal",
|
||||
align: "center",
|
||||
// align: "center"
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
@ -282,6 +280,22 @@ function drawEchart() {
|
||||
};
|
||||
echartsTest.setOption(option, true);
|
||||
}
|
||||
|
||||
//获取安全管理
|
||||
// const safeData = ref(null as any);
|
||||
const getSafeInfo = async () => {
|
||||
const res: any = await getProjectInspectRecordCountApi({ projectSn: store.sn });
|
||||
// console.log("获取安全管理", res);
|
||||
// safeData.value = res.result;
|
||||
dataList.value[0].value = res.result.rectificationNum;
|
||||
dataList.value[1].value = res.result.totalNum - res.result.rectificationNum;
|
||||
questionTotal.value = res.result.totalNum;
|
||||
drawEchart();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getSafeInfo();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user