From 6b778bbfbb3304a3e4f96c4b98d1a0e0059b9260 Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Fri, 31 May 2024 18:31:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/js/http.js | 4 +- .../projectFront/carManage/carStatictis.vue | 69 ++++++- .../configManage/personnelAccess.vue | 122 +++++++---- .../progressManagementAg/ganttChart.vue | 68 +++++- .../projectganttChart.vue | 194 ++++++++---------- 5 files changed, 300 insertions(+), 157 deletions(-) diff --git a/src/assets/js/http.js b/src/assets/js/http.js index 28ac18c0..2b1f91ab 100644 --- a/src/assets/js/http.js +++ b/src/assets/js/http.js @@ -95,9 +95,9 @@ if (process.env.NODE_ENV == "development") { // axios.defaults.baseURL = 'http://125.88.207.86:8099/'//中建四局(沙湖)线上(最新)地址 // axios.defaults.baseURL = 'http://jxj.zhgdyun.com:15551/'//测试地址 // axios.defaults.baseURL = 'http://47.93.215.234:9809/'//鞍钢正式地址(弃用) - // axios.defaults.baseURL = 'http://42.180.188.17:9809/'//鞍钢正式地址 + axios.defaults.baseURL = 'http://42.180.188.17:9809/'//鞍钢正式地址 // axios.defaults.baseURL = 'http://47.93.215.234:11211/'//鞍钢测试地址(弃用) - axios.defaults.baseURL = "http://42.180.188.17:11211/"; //鞍钢测试地址 + // axios.defaults.baseURL = "http://42.180.188.17:11211/"; //鞍钢测试地址 // axios.defaults.baseURL = 'http://jxj.zhgdyun.com:19814/'//测试地址 } else if (process.env.NODE_ENV == "debug") { axios.defaults.baseURL = "https://www.ceshi.com"; diff --git a/src/views/projectFront/carManage/carStatictis.vue b/src/views/projectFront/carManage/carStatictis.vue index f928521e..68da3a78 100644 --- a/src/views/projectFront/carManage/carStatictis.vue +++ b/src/views/projectFront/carManage/carStatictis.vue @@ -6,55 +6,75 @@
-
今日车辆出入记录统计
+
+
今日车辆出入记录统计
+
+ + 进场 + 出场 + +
+

{{ totalNum.innum }}

-

今日总进场车次

-
+

{{ totalNum.wlcInNum }}

-

外来车辆进场车次

+
+

{{ totalNum.wlcOutNum }}

+

外来车辆出场车次

+
-
+

{{ totalNum.gdcInNum }}

-

固定车进场车次

+
+

{{ totalNum.gdcOutNum }}

+

固定车出场车次

+

{{ totalNum.outnum }}

-

今日总出场车次

-
+

{{ totalNum.cqcInNum }}

-

长期车进场车次

+
+

{{ totalNum.cqcOutNum }}

+

长期车出场车次

+
-
+

{{ totalNum.lscInNum }}

临时车进场车次

+
+

{{ totalNum.lscOutNum }}

+ +

临时车出场车次

+
@@ -235,6 +255,7 @@ import { export default { data() { return { + timeRadio: "1", carDataTypeList: [ { value: 1, @@ -360,10 +381,26 @@ export default { //车辆数量统计---图表 carNumCharts(el) { console.log(this.totalCarNum, 888999); + let totalNum = 0; + for(let i in this.totalCarNum){ + totalNum += this.totalCarNum[i] + } let that = this; let numChart = echarts.init(el); // ageChart.clear(); let option = { + title: { + text: totalNum, //标题文本 + x: "50.5%", + y: "35%", + z: 8, + textAlign: "center", + textStyle: { + fontFamily: "微软雅黑", + fontSize: 36, + color: "#9B9B9B", + }, + }, color: ["#2478F2", "#84B7F9", "#5F9CF8"], tooltip: { trigger: "item", @@ -539,6 +576,18 @@ export default { display: flex; &-left { width: 60%; + .search-title { + display: flex; + align-items: center; + justify-content: space-between; + .pageTitle { + margin-bottom: 0px; + line-height: 20px; + } + .condition-change { + margin-right: 5px; + } + } .left-data { width: 100%; margin-top: 60px; diff --git a/src/views/projectFront/configManage/personnelAccess.vue b/src/views/projectFront/configManage/personnelAccess.vue index 66b616d3..89b79f04 100644 --- a/src/views/projectFront/configManage/personnelAccess.vue +++ b/src/views/projectFront/configManage/personnelAccess.vue @@ -395,7 +395,7 @@
{ - this.$refs.treeRef.setChecked(item.id, true, true); - }); - } + arr.map((item) => { + this.$refs.treeRef.setChecked(item.id, true, true); + if (item.children && item.children.length) { + this.handleTreeCheckAllFn(item.children); + } + }); }, handleTreeCheckAllChange(val) { this.isIndeterminate = false; @@ -776,38 +775,91 @@ export default { this.$refs.treeRef.setCheckedKeys([]); } }, + // 检查是否有未勾选的节点 + hasUncheckedNodes(treeData) { + const tree = this.$refs.treeRef; + return treeData.some((node) => { + const isUnchecked = !tree.getNode(node).checked && !tree.getNode(node).indeterminate; + if (isUnchecked) return true; + if (node.children && node.children.length) { + return this.hasUncheckedNodes(node.children); + } + return false; + }); + }, + // 检查是否有勾选的节点 + hasCheckedNodes(treeData) { + const tree = this.$refs.treeRef; + return treeData.some((node) => { + const isChecked = tree.getNode(node).checked; + if (isChecked) return true; + if (node.children && node.children.length) { + return this.hasCheckedNodes(node.children); + } + return false; + }); + }, + // 检查是否有半选中的节点 + hasIndeterminateNodes(treeData) { + const tree = this.$refs.treeRef; + return treeData.some((node) => { + if (tree.getNode(node).indeterminate) return true; + if (node.children && node.children.length) { + return this.hasIndeterminateNodes(node.children); + } + return false; + }); + }, // 获取当前选中的节点 testCheckChange() { + // 父子不关联用这套 + this.checkAll = true; // 默认先全选 const tree = this.$refs.treeRef; - let checkedCount = 0; - let disabledCount = 0; - let indeterminateFlag = false; - for (let i = 0; i < this.treeDatas.length; i++) { - if (tree.getNode(this.treeDatas[i]).disabled == true) { - disabledCount += 1; // 如果有置灰的节点,置灰变量加1 - } - if (tree.getNode(this.treeDatas[i]).checked == true) { - checkedCount += 1; // 如果有勾选的节点,勾选变量加1 - } - if (tree.getNode(this.treeDatas[i]).indeterminate == true) { - indeterminateFlag = true; // 如果有半选的节点,半选变量设为true - } - } - if (checkedCount == 0) { - this.isIndeterminate = false; - this.checkAll = false; // 如果勾选的一级节点数为0,则设置全选按钮样式不为半选样式,全选的值为false - if (indeterminateFlag == true) { - this.isIndeterminate = true; - this.checkAll = false; - } - } else if (checkedCount + disabledCount == this.treeDatas.length) { - this.isIndeterminate = false; - this.checkAll = true; - } else { - this.isIndeterminate = true; + // 使用方法 + const hasUnchecked = this.hasUncheckedNodes(this.treeDatas); + const hasChecked = this.hasCheckedNodes(this.treeDatas); + // const hasIndeterminate = this.hasIndeterminateNodes(this.treeDatas); + if (hasUnchecked && hasChecked) { this.checkAll = false; + this.isIndeterminate = true; + } else if(!hasUnchecked && hasChecked){ + this.checkAll = true; + this.isIndeterminate = false; + } else if(!hasChecked){ + this.checkAll = false; + this.isIndeterminate = false; } - return; + // 父子关联用这套 + // const tree = this.$refs.treeRef; + // let checkedCount = 0; + // let disabledCount = 0; + // let indeterminateFlag = false; + // for (let i = 0; i < this.treeDatas.length; i++) { + // if (tree.getNode(this.treeDatas[i]).disabled == true) { + // disabledCount += 1; // 如果有置灰的节点,置灰变量加1 + // } + // if (tree.getNode(this.treeDatas[i]).checked == true) { + // checkedCount += 1; // 如果有勾选的节点,勾选变量加1 + // } + // if (tree.getNode(this.treeDatas[i]).indeterminate == true) { + // indeterminateFlag = true; // 如果有半选的节点,半选变量设为true + // } + // } + // if (checkedCount == 0) { + // this.isIndeterminate = false; + // this.checkAll = false; // 如果勾选的一级节点数为0,则设置全选按钮样式不为半选样式,全选的值为false + // if (indeterminateFlag == true) { + // this.isIndeterminate = true; + // this.checkAll = false; + // } + // } else if (checkedCount + disabledCount == this.treeDatas.length) { + // this.isIndeterminate = false; + // this.checkAll = true; + // } else { + // this.isIndeterminate = true; + // this.checkAll = false; + // } + // return; }, getTreeEnterpriseList() { selectHierarchyEnterpriseListApi({ diff --git a/src/views/projectFront/progressManagementAg/ganttChart.vue b/src/views/projectFront/progressManagementAg/ganttChart.vue index f553f741..d240c5e5 100644 --- a/src/views/projectFront/progressManagementAg/ganttChart.vue +++ b/src/views/projectFront/progressManagementAg/ganttChart.vue @@ -109,7 +109,6 @@ type="primary" size="medium" @click="updateProgressFn(1)" - >更新项目总进度 @@ -162,6 +161,15 @@ >
+
+
查看里程碑节点
+
+ 日期:{{ isShowDate(date, day.num) }} + 里程碑:{{ isShowLcText(date, day.num) }} +
+
@@ -1071,6 +1079,27 @@ export default { } }); }, + isShowLcText(date, day) { + let dateEntiry = ""; + if (day < 10) { + dateEntiry = date + "-0" + day; + } else { + dateEntiry = date + "-" + day; + } + let item = this.listData.find((item) => { + return item.milestoneTime == dateEntiry; + }); + return item ? item.milestoneName : ""; + }, + isShowDate(date, day) { + let dateEntiry = ""; + if (day < 10) { + dateEntiry = date + "-0" + day; + } else { + dateEntiry = date + "-" + day; + } + return dateEntiry; + }, isShowTopTip(date, day) { let dateEntiry = ""; if (day < 10) { @@ -1781,6 +1810,12 @@ export default { width: 20px; height: 20px; } + // .tip-box { + // width: 180px; + // height: 150px; + // position: absolute; + // z-index: 10; + // } .dash-line { border: 1px dashed #d81e06; height: 100%; @@ -1790,6 +1825,37 @@ export default { left: -2px; z-index: 20; } + .info-show { + width: 180px; + height: 150px; + border: 1px solid #ccc; + background-color: white; + padding: 10px 15px; + position: absolute; + top: 15px; + left: 20px; + z-index: 30; + display: none; + transition: 0.5s; + &-title { + text-align: left; + text-indent: 0.5em; + border-left: 2px solid #0894f0; + } + &-content { + margin-top: 10px; + display: flex; + flex-direction: column; + justify-content: center; + span { + margin-top: 15px; + } + } + } + } + + .tip-show img:hover ~ .info-show { + display: block; } } } diff --git a/src/views/projectFront/progressManagementAg/projectganttChart.vue b/src/views/projectFront/progressManagementAg/projectganttChart.vue index ec6a9918..530d5fc8 100644 --- a/src/views/projectFront/progressManagementAg/projectganttChart.vue +++ b/src/views/projectFront/progressManagementAg/projectganttChart.vue @@ -322,17 +322,17 @@ top: '10px', left: calcLeft(gantt, forTimesFn(p), index) + 'px', }" - v-show="isShowTip(p, index + 1)" - > - -
-
查看里程碑节点
-
- 日期:{{ isShowDate(p, index + 1) }} - 里程碑:主体结构施工 -
+ v-show="isShowTip(p, index)" + > + +
+
查看里程碑节点
+
+ 日期:{{ isShowDate(p, index) }} + 里程碑:{{ isShowLcText(p, index) }}
+
@@ -416,16 +416,16 @@ top: '10px', left: calcLeft(gantt, forTimesFn(p), index) + 'px', }" - v-show="isShowTip(p, index + 1)" - > - -
-
查看里程碑节点
-
- 日期:{{ isShowDate(p, index + 1) }} - 里程碑:主体结构施工 -
-
+ v-show="isShowTip(p, index)" + > + +
+
查看里程碑节点
+
+ 日期:{{ isShowDate(p, index) }} + 里程碑:{{ isShowLcText(p, index) }} +
+
@@ -509,16 +509,16 @@ top: '10px', left: calcLeft(gantt, forTimesFn(p), index) + 'px', }" - v-show="isShowTip(p, index + 1)" - > - -
-
查看里程碑节点
-
- 日期:{{ isShowDate(p, index + 1) }} - 里程碑:主体结构施工 -
-
+ v-show="isShowTip(p, index)" + > + +
+
查看里程碑节点
+
+ 日期:{{ isShowDate(p, index) }} + 里程碑:{{ isShowLcText(p, index) }} +
+
@@ -603,18 +603,16 @@ left: calcLeft(gantt, forTimesFn(p), index) + 'px', }" - v-show="isShowTip(p, index + 1)" - > - -
-
查看里程碑节点
-
- 日期:{{ isShowDate(p, index + 1) }} - 里程碑:主体结构施工 -
-
+ v-show="isShowTip(p, index)" + > + +
+
查看里程碑节点
+
+ 日期:{{ isShowDate(p, index) }} + 里程碑:{{ isShowLcText(p, index) }} +
+
@@ -698,20 +696,16 @@ left: calcLeft(gantt, forTimesFn(p), index) + 'px', }" - v-show="isShowTip(p, index + 1)" - > - -
-
- 查看里程碑节点 -
-
- 日期:{{ isShowDate(p, index + 1) }} - 里程碑:主体结构施工 -
-
+ v-show="isShowTip(p, index)" + > + +
+
查看里程碑节点
+
+ 日期:{{ isShowDate(p, index) }} + 里程碑:{{ isShowLcText(p, index) }} +
+
@@ -796,22 +790,16 @@ calcLeft(gantt, forTimesFn(p), index) + 'px', }" - v-show="isShowTip(p, index + 1)" - > - -
-
- 查看里程碑节点 -
-
- 日期:{{ - isShowDate(p, index + 1) - }} - 里程碑:主体结构施工 -
-
+ v-show="isShowTip(p, index)" + > + +
+
查看里程碑节点
+
+ 日期:{{ isShowDate(p, index) }} + 里程碑:{{ isShowLcText(p, index) }} +
+
@@ -900,22 +888,16 @@ calcLeft(gantt, forTimesFn(p), index) + 'px', }" - v-show="isShowTip(p, index + 1)" - > - -
-
- 查看里程碑节点 -
-
- 日期:{{ - isShowDate(p, index + 1) - }} - 里程碑:主体结构施工 -
-
+ v-show="isShowTip(p, index)" + > + +
+
查看里程碑节点
+
+ 日期:{{ isShowDate(p, index) }} + 里程碑:{{ isShowLcText(p, index) }} +
+
@@ -1003,22 +985,16 @@ calcLeft(gantt, forTimesFn(p), index) + 'px', }" - v-show="isShowTip(p, index + 1)" - > - -
-
- 查看里程碑节点 -
-
- 日期:{{ - isShowDate(p, index + 1) - }} - 里程碑:主体结构施工 -
-
+ v-show="isShowTip(p, index)" + > + +
+
查看里程碑节点
+
+ 日期:{{ isShowDate(p, index) }} + 里程碑:{{ isShowLcText(p, index) }} +
+
@@ -1271,7 +1247,7 @@ export default { const today = moment(obj.startDate) // 计算多少天后的日期 - const twoDaysLater = today.add(dayAfter, "days").format("YYYY-MM-DD"); + // const twoDaysLater = today.add(dayAfter, "days").format("YYYY-MM-DD"); let daysLaterDate = ""; if(dayAfter === 0){ daysLaterDate = today.format("YYYY-MM-DD"); @@ -1284,24 +1260,24 @@ export default { responseResult = item.milestoneName; } }); + return responseResult; } else { responseResult = ""; + return responseResult; } // if(twoDaysLater == obj.finishDate){ // return true; // } else { // return false; // } - return responseResult; }, isShowTip(obj, dayAfter) { - console.log(dayAfter,123456789) let responseResult = false; // 获取当前日期 const today = moment(obj.startDate); // 计算多少天后的日期 - const twoDaysLater = today.add(dayAfter, "days").format("YYYY-MM-DD"); + // const twoDaysLater = today.add(dayAfter, "days").format("YYYY-MM-DD"); let daysLaterDate = ""; if(dayAfter === 0){ daysLaterDate = today.format("YYYY-MM-DD"); @@ -1311,11 +1287,11 @@ export default { if (obj.xzMilestoneList) { obj.xzMilestoneList.map((item) => { if (item.milestoneTime == daysLaterDate) { + console.log(item.milestoneTime,111) + console.log(daysLaterDate,222) responseResult = true; } }); - } else { - responseResult = false; } // if(twoDaysLater == obj.finishDate){ // return true;