diff --git a/src/api/largeScreen.js b/src/api/largeScreen.js index 4747a04..b83c3f7 100644 --- a/src/api/largeScreen.js +++ b/src/api/largeScreen.js @@ -35,3 +35,10 @@ export const getBadGasEchartsInfo = (tunnelId) => { method: 'get' }) } +//电流监控数据 +export const getFanEchartsInfo = (equipmentId) => { + return request({ + url: `/tunnel/large/screen/echarts/current/${equipmentId}`, + method: 'get' + }) +} diff --git a/src/api/site.js b/src/api/site.js index bc3f24e..cc86624 100644 --- a/src/api/site.js +++ b/src/api/site.js @@ -29,7 +29,7 @@ export const addSite = (data) => { } export const deleteSite = (siteIdList) => { return request({ - url: `/tunnel/site/${siteIdList}`, + url: `/tunnel/site/delete/${siteIdList}`, method: 'delete' }) } diff --git a/src/api/tunnelManage.js b/src/api/tunnelManage.js new file mode 100644 index 0000000..7b85487 --- /dev/null +++ b/src/api/tunnelManage.js @@ -0,0 +1,67 @@ +import request from '@/utils/request.js' + +export const getTunnelList = (params) => { + return request({ + url: '/tunnel/tunnel/screen/list', + method: 'get', + params + }) +} +export const getTunnelDetail = (tunnelId) => { + return request({ + url: `/tunnel/tunnel/${tunnelId}`, + method: 'get' + }) +} +export const addTunnel = (data) => { + return request({ + url: '/tunnel/tunnel', + method: 'post', + data + }) +} +export const deleteTunnel = (tunnelIdList) => { + return request({ + url: `/tunnel/tunnel/${tunnelIdList}`, + method: 'delete' + }) +} +//设备信息列表 +export const getEquipmentList = (tunnelId) => { + return request({ + url: '/tunnel/equipment/equipments', + method: 'get', + params:{ + tunnelId:tunnelId + } + }) +} +export const editTunnel = (data) => { + return request({ + url: '/tunnel/model/details', + method: 'put', + data + }) +} +//设备管理-风机设备信息修改 +export const editFan = (data) => { + return request({ + url: '/tunnel/equipment/frequency/equipments', + method: 'put', + data + }) +} +export const editEquipment = (data) => { + return request({ + url: '/tunnel/equipment/equipments', + method: 'put', + data + }) +} +export const editAcquisitions = (data) => { + return request({ + url: '/tunnel/equipment/frequency/acquisitions', + method: 'put', + data + }) +} diff --git a/src/api/tunnelScene.js b/src/api/tunnelScene.js index 5b1aa0a..43b4edc 100644 --- a/src/api/tunnelScene.js +++ b/src/api/tunnelScene.js @@ -42,3 +42,12 @@ export const saveEquipment = ( }, }); }; + +// 保存模型(新增) +export const apiSaveEquipment = (data) => { + return request({ + url: "/tunnel/model/details", + method: "put", + data, + }); +}; diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index aaeb918..f98121e 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -86,6 +86,23 @@ body, } } + .top-length { + z-index: 2; + position: absolute; + top: 190px; + width: 100%; + display: flex; + justify-content: center; + font-size: 50px; + //font-weight: bold; + color: #0BE9FA; + + > span:last-child { + margin-left: 40px; + } + + } + .top-right { z-index: 2; position: absolute; @@ -281,6 +298,11 @@ body, height: 1160px; //width: 1300px; } + #containerFan { + flex: 1; + height: 1160px; + //width: 1300px; + } #containerBad { flex: 1; @@ -487,43 +509,53 @@ body, background: #072247 !important; border: 1px solid #0F82AF !important; } + .el-popper { max-width: 200px !important; box-sizing: border-box; } + .el-popper__arrow::before { display: none; } -.el-select-dropdown{ - width: 200px!important; + +.el-select-dropdown { + width: 200px !important; } -.el-select-dropdown__item{ - >span{ + +.el-select-dropdown__item { + > span { color: #FFFFFF; } } + .el-select .el-input .el-select__caret { - font-size: 35px!important; + font-size: 35px !important; } -.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{ - background-color: #064B66!important; - width:198px!important; + +.el-select-dropdown__item.hover, .el-select-dropdown__item:hover { + background-color: #064B66 !important; + width: 198px !important; } -.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{ - background-color: #064B66!important; - width:200px!important; + +.el-select-dropdown.is-multiple .el-select-dropdown__item.selected { + background-color: #064B66 !important; + width: 200px !important; } -.el-select-tags-wrapper{ - .el-tag{ - padding: 28px 20px!important; + +.el-select-tags-wrapper { + .el-tag { + padding: 28px 20px !important; font-size: 35px; - .el-icon{ + + .el-icon { width: 40px; height: 40px; - font-size: 40px!important; + font-size: 40px !important; } } } + .current-site { .el-select-dropdown { width: 200px !important; diff --git a/src/components/content/airInfo/AirInfo.vue b/src/components/content/airInfo/AirInfo.vue index af1d516..da15cf9 100644 --- a/src/components/content/airInfo/AirInfo.vue +++ b/src/components/content/airInfo/AirInfo.vue @@ -15,8 +15,10 @@ :unit="item.unit" @click="handleOpenAirChart(item)" /> +
- +
@@ -35,7 +37,8 @@
- +
@@ -87,10 +90,12 @@ watch(() => props.list, (now) => { }) }, {deep: true}); watch(() => props.airData, (now) => { - if(now.sensorList===null){ - airList.value=[] - }else { - getAirInfo(now.sensorList) + if (now.sensorList !== null) { + if (now.sensorList.length === 0) { + airList.value = [] + } else { + getAirInfo(now.sensorList) + } } }, {deep: true}); const getChartInfo = (equipmentId) => { @@ -235,7 +240,7 @@ const initChart = (type, values) => { xAxis: { type: 'category', // data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '24:00'], - data:type, + data: type, axisLabel: { textStyle: { fontSize: 45, @@ -257,7 +262,7 @@ const initChart = (type, values) => { series: [ { // data: [3, 85, 47, 92, 17, 76, 69, 25, 56, 12, 89, 34, 71, 43, 67, 20, 98, 72, 19, 61, 31, 49, 81, 63], - data:values, + data: values, type: 'line', smooth: true, symbolSize: 24, @@ -330,7 +335,7 @@ const initAirChart = (type, values) => { xAxis: { type: 'category', // data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00', '24:00'], - data:type, + data: type, axisLabel: { textStyle: { fontSize: 45, @@ -352,7 +357,7 @@ const initAirChart = (type, values) => { series: [ { // data: [56, 12, 89, 34, 71, 43, 67, 20, 98, 72, 19, 61, 3, 85, 47, 92, 17, 76, 69, 25, 31, 49, 81, 63], - data:values, + data: values, type: 'line', smooth: true, symbolSize: 24, @@ -376,7 +381,7 @@ const initAirChart = (type, values) => { position: absolute; z-index: 100; width: 824px; - height: 400px; + //height: 400px; top: 1003px; right: 72px; background-image: url(@/assets/images/airInfo/bg.png); diff --git a/src/components/content/badGasInfo/BadGasInfo.vue b/src/components/content/badGasInfo/BadGasInfo.vue index 5a00814..9132857 100644 --- a/src/components/content/badGasInfo/BadGasInfo.vue +++ b/src/components/content/badGasInfo/BadGasInfo.vue @@ -358,7 +358,7 @@ const initChart = (type, values) => { cursor: pointer; position: absolute; width: 824px; - height: 621px; + //height: 621px; top: 1441px; right: 72px; background-image: url(../../../assets/images/badGasInfo/bg.png); diff --git a/src/components/content/fanInfo/FanInfo.vue b/src/components/content/fanInfo/FanInfo.vue index 5341993..b8aa4d4 100644 --- a/src/components/content/fanInfo/FanInfo.vue +++ b/src/components/content/fanInfo/FanInfo.vue @@ -64,17 +64,38 @@
-
- +
+
+
+ +
+
+
+
+
+
+ + + + + + + +
+
+
+
- \ No newline at end of file diff --git a/src/views/login/index.vue b/src/views/login/index.vue index b8ac2d9..b93c23c 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -45,8 +45,10 @@ import {User, Lock, Key} from "@element-plus/icons-vue"; const router = useRouter(); const authStore = useAuthStore(); const loginForm = reactive({ - username: "admin", + // username: "admin", password: "123456", + username: "administrator", + // password: "", code: "", uuid: "", }); diff --git a/src/views/site/index.vue b/src/views/site/index.vue index 44ce543..997db05 100644 --- a/src/views/site/index.vue +++ b/src/views/site/index.vue @@ -22,19 +22,20 @@
站点名称:{{ item.siteName }} - + + 默认
-
隧道数量:{{ item.tunnelList.length }}条 +
隧道数量:{{ item.totalTunnel }}条
-
+
{{ item.info.tunnelName }}
施工长度{{ item.info.constructionLength }}米
-
实现长度{{ item.info.totalLength }}公里 +
实现长度{{ item.info.totalLength }}米
@@ -65,6 +66,12 @@ + + + + + + @@ -86,11 +93,11 @@
@@ -100,6 +107,7 @@ import {editSite, getSiteDetail, getSiteList, addSite, deleteSite} from "@/api/s import {ElMessage, ElMessageBox} from "element-plus"; const router = useRouter() +const userId = reactive(router.currentRoute.value.params.userId) const siteList = ref([ // { // siteName: '松江站', @@ -137,8 +145,8 @@ const info = ref({ totalLength: 0 }) const title = ref('新增站点') -const isClick = ref(false); const isVisited = ref(false); +const showFirst = ref(true) const total = ref(10); const showAddIcon = ref(true) const pageInfo = reactive({ @@ -148,7 +156,8 @@ const pageInfo = reactive({ const form = ref({ address: '', siteName: '', - describe: '' + describe: '', + isDefault: false }); const formRules = ref({ siteName: [{required: true, message: '请输入站点名称', trigger: 'blur'}] @@ -156,10 +165,16 @@ const formRules = ref({ const formInstance = ref() const getList = () => { getSiteList({ + userId:userId, ...pageInfo }).then((res) => { total.value = res.data.total; - showAddIcon.value = total.value % 6!==0; + if(total.value==0){ + + }else { + showAddIcon.value = total.value % 6!==0; + } + showFirst.value = total.value / pageInfo.pageSize > 1; res.data.rows.map(item => { if (item.tunnelList === null || item.tunnelList.length === 0) { item.info = info.value @@ -170,7 +185,6 @@ const getList = () => { }) siteList.value = res.data.rows; - console.log('res',siteList.value) }); } getList() @@ -192,15 +206,16 @@ const handleClickSite = (type) => { } } const goToAddTunnel = (siteId) => { - router.push('/tunnel/' + siteId) - // router.push('/tunnel/1') + router.push('/tunnel/' + siteId+'/s'+'/'+userId) } + //重置from表单 const restFrom = () => { form.value = { address: '', siteName: '', - describe: '' + describe: '', + isDefault: false } } const handleEdit = (item) => { @@ -223,14 +238,24 @@ const handleSubmit = (instance) => { instance.validate(async (valid) => { if (!valid) return if (title.value === '编辑站点') { - editSite(form.value).then(() => { - isVisited.value = false - getList() + editSite(form.value).then((res) => { + if(res.code===1000){ + isVisited.value = false + getList() + ElMessage.success(res.msg) + }else { + ElMessage.warning(res.msg) + } }); } else { - addSite(form.value).then(() => { - isVisited.value = false - getList() + addSite(form.value).then((res) => { + if(res.code===1000){ + isVisited.value = false + getList() + ElMessage.success(res.msg) + }else { + ElMessage.warning(res.msg) + } }); } }) @@ -238,32 +263,63 @@ const handleSubmit = (instance) => { const handleChooseAll=()=>{ siteList.value.map(item=>{ item.checked=!item.checked + if(item.checked&&!item.isDefault){ + siteIds.value.push(item.siteId) + }else if(!item.checked&&!item.isDefault){ + siteIds.value.map((newItem, index) => { + if (newItem === item.siteId) { + siteIds.value.splice(index, 1) + } + }) + } }) } const handleMoreDelete = () => { if (siteIds.value.length === 0) { ElMessage.warning('请先选择站点进行删除') } else { - ElMessageBox.confirm(`是否确定删除该站点`, '系统提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning', - customClass: 'delBox' - }).then(() => { - deleteSite(siteIds.value).then(res => { - if (res.code === 1000) { - ElMessage.success(res.msg) - getList() - siteIds.value = [] - siteNameList.value = [] - } else { - ElMessage.error(res.msg) + let flag=false + siteList.value.map(item=>{ + siteIds.value.map(siteItem=>{ + if(item.siteId===siteItem){ + if(item.tunnelList.length!==0){ + ElMessage.error('该站点下存在隧道,不能删除!') + flag=false + }else { + flag=true + } } }) }) + if(flag){ + ElMessageBox.confirm(`是否确定删除该站点`, '系统提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + customClass: 'delBox' + }).then(() => { + deleteSite(siteIds.value).then(res => { + if (res.code === 1000) { + ElMessage.success(res.msg) + getList() + siteIds.value = [] + siteNameList.value = [] + } else { + ElMessage.error(res.msg) + } + }) + }) + } } } - +const firstPage=()=>{ + pageInfo.pageNum = 1 + getList() +} +const lastPage=()=>{ + pageInfo.pageNum = total.value/pageInfo.pageSize + getList() +} //点击页码进行分页功能 const handleCurrentChange = (val) => { pageInfo.pageNum = val @@ -272,6 +328,37 @@ const handleCurrentChange = (val) => {