Commit 06c93b82a4f611f581e2f9ebc3523a6f96a06c0e

Authored by guzijian
1 parent a6ad0dd2

feat: 修改样式

src/components/ConstForm/index.vue
1 1 <template>
2   - <div v-loading="loading" element-loading-text="加载详情..." element-loading-svg-view-box="-10, -10, 50, 50"
3   - element-loading-background="#062a5ac5">
  2 + <div v-loading="loading" element-loading-text="加载详情..." element-loading-svg-view-box="-10, -10, 50, 50">
4 3 <div class="person-info">
5 4 <div class="font-box">
6 5 <span class="label">
... ... @@ -35,7 +34,7 @@
35 34 </div>
36 35 </div>
37 36 </div>
38   - <div style="display: flex;align-items: center;margin-bottom: 7px; color: #0CFCFC; font-size: 13px; margin-top: 15px;">
  37 + <div style="display: flex;align-items: center;margin-bottom: 7px; color: green; font-size: 13px; margin-top: 15px;">
39 38 打卡详情</div>
40 39 <div class="mainTable">
41 40 <el-table :data="info.signInfos" style="width: 100%;">
... ... @@ -115,26 +114,26 @@ watch(
115 114 :deep(.mainTable .el-table .el-table__header-wrapper th, .el-table .el-table__fixed-header-wrapper th) {
116 115 text-align: center;
117 116 font-weight: bold;
118   - color: white;
119   - background-color: #0359A4 !important;
  117 + color: black;
  118 + background-color: #f4f4f5d3 !important;
120 119 font-size: 0.5vw;
121 120 height: 20px !important;
122 121 }
123 122  
124 123 :deep(.mainTable .el-table__empty-text) {
125 124 line-height: 30px !important;
126   - color: white;
  125 + color: black;
127 126 font-weight: bold;
128 127 font-size: 0.5vw;
129 128 }
130 129  
131 130 :deep(.mainTable .el-table__empty-block) {
132 131 min-height: 30px !important;
133   - background-color: #041e74d5;
  132 + background-color: #f4f4f5d3;
134 133 }
135 134  
136 135 :deep(.mainTable .el-table tr) {
137   - background-color: #03113F;
  136 + background-color: #f4f4f5d3;
138 137 }
139 138  
140 139 :deep(.mainTable .el-table .el-table__cell) {
... ... @@ -143,17 +142,12 @@ watch(
143 142 }
144 143  
145 144 :deep(.mainTable .el-table tbody tr:hover>td) {
146   - background: rgba(39, 54, 91, 0.571) !important;
  145 + background: #ffffff !important;
147 146 }
148 147  
149   -// :deep(.mainTable .el-table th) {
150   -// border: 1px solid black !important;
151   -// border-right: none !important;
152   -// border-bottom: none !important;
153   -// }
154 148  
155 149 :deep(.el-table td) {
156   - border: 1px solid #033E72;
  150 + border: 1px solid #c5c7c9;
157 151 border-right: none !important;
158 152 }
159 153  
... ... @@ -161,12 +155,13 @@ watch(
161 155 :deep(.mainTable td .cell) {
162 156 text-align: center;
163 157 font-size: 0.5vw;
164   - color: white;
  158 + color: black;
165 159 }
166 160  
167 161 // 修改行单元格内边距
168 162 :deep(.mainTable .el-table .cell) {
169 163 padding: 1px !important;
  164 + box-sizing: border-box;
170 165 }
171 166  
172 167 .person-info {
... ... @@ -174,6 +169,7 @@ watch(
174 169 display: flex;
175 170 flex-wrap: wrap;
176 171 justify-content: space-between;
  172 + box-sizing: border-box;
177 173  
178 174 .font-box {
179 175 width: 50%;
... ... @@ -184,19 +180,19 @@ watch(
184 180 align-items: center;
185 181  
186 182 .label {
187   - color: #0CFCFC;
  183 + color: green;
188 184 font-family: "黑体", "圆体";
189 185 font-weight: 500;
190 186 width: 39px;
191 187 }
192 188  
193 189 .content-box {
194   - color: white;
  190 + color: black;
195 191 width: 95.5px;
196 192 box-sizing: border-box;
197 193 padding: 2px;
198 194 text-align: center;
199   - background-color: #03113F;
  195 + background-color: #f4f4f5d3;
200 196  
201 197 .content-text {
202 198 display: flex;
... ...
src/components/FleetContentBox/index.vue
1 1 <template>
2 2 <div @wheel="handleWheel" ref="fleetContentBox" :class="{ scrolling: isScrolling }" class="fleet-content-box">
3   - <!-- <vue3-seamless-scroll :list="item.fleetInfos" :step="1" :hoverStop="true" :hover="true"> -->
4 3 <!-- 线路信息 -->
5   - <div v-for="(childItem, childIndex) in item.fleetInfos" :key="childItem.lineName" class="fleet-line-info-container">
6   - <!-- <div class="line-box" style="height: 1px; margin: 5px; background-color: #0761ba;"></div> -->
7   -
  4 + <div v-for="(childItem, childIndex) in item.fleetInfos" :key="childItem.lineName" ref="fleetLineInfoContainer"
  5 + class="fleet-line-info-container">
8 6 <div :id="childItem.lineName" class="fleet-line-title">
9 7 {{ childItem.lineName }}
10 8 </div>
... ... @@ -12,7 +10,8 @@
12 10 <div ref="fleetNbbmInfoContainer" class="fleet-nbbm-info-container">
13 11 <div v-for="(sunItem, sunIndex) in childItem.lineInfos" :key="sunItem.nbbm" class="fleet-nbbm-info-item">
14 12 <div v-if="sunItem.saleInfoVo != null" class="fleet-nbbm-info-have-sale">
15   - <el-popover popper-class="fleet-popover-style" placement="top" :title="childItem.lineName" :width="320"
  13 + <el-popover popper-class="fleet-popover-style" placement="top-start" :title="childItem.lineName" :width="320"
  14 + :open-delay="500" :popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
16 15 :show-after="200" @after-enter="alterEnterHandler(sunItem.driverInfoVo.jobCode)">
17 16 <ConstForm :showFlag="personSignInfo.jobCode == sunItem.driverInfoVo.jobCode"
18 17 :currentDateKey="currentDateKey" :jobCode="sunItem.driverInfoVo.jobCode" />
... ... @@ -30,7 +29,8 @@
30 29 </span>
31 30 </span>
32 31 </div>
33   - <el-popover popper-class="fleet-popover-style" placement="top" :title="childItem.lineName" :width="320"
  32 + <el-popover popper-class="fleet-popover-style" placement="top-start" :title="childItem.lineName" :width="320"
  33 + :open-delay="500" :popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
34 34 :show-after="200" @after-enter="alterEnterHandler(sunItem.saleInfoVo.jobCode)">
35 35 <ConstForm :showFlag="personSignInfo.jobCode == sunItem.saleInfoVo.jobCode" :currentDateKey="currentDateKey"
36 36 :jobCode="sunItem.saleInfoVo.jobCode" />
... ... @@ -41,7 +41,8 @@
41 41 </el-popover>
42 42 </div>
43 43 <el-popover v-else :show-after="200" @after-enter="alterEnterHandler(sunItem.driverInfoVo.jobCode)"
44   - placement="top" :title="childItem.lineName" popper-class="fleet-popover-style" :width="320">
  44 + :open-delay="500" :popper-options="{ boundariesElement: 'viewport', removeOnDestroy: true }"
  45 + placement="top-start" :title="childItem.lineName" popper-class="fleet-popover-style" :width="320">
45 46 <ConstForm :showFlag="personSignInfo.jobCode == sunItem.driverInfoVo.jobCode" :currentDateKey="currentDateKey"
46 47 :jobCode="sunItem.driverInfoVo.jobCode" />
47 48 <template #reference>
... ... @@ -55,12 +56,12 @@
55 56 </div>
56 57 </div>
57 58 </div>
58   - <!-- </vue3-seamless-scroll> -->
59 59 </div>
60 60 </template>
61 61 <script setup>
62 62 import ConstForm from '@/components/ConstForm/index.vue';
63   -import { nextTick, onMounted, ref } from 'vue';
  63 +import { nextTick, onMounted, reactive, ref } from 'vue';
  64 +const popoverRef = ref({});
64 65 const props = defineProps({
65 66 item: {
66 67 type: Object,
... ... @@ -91,7 +92,8 @@ const personSignInfo = reactive(
91 92 const isScrolling = ref(false);
92 93 // 元素信息
93 94 const fleetNbbmInfoContainer = ref();
94   -const fleetContentBox = ref()
  95 +const fleetContentBox = ref();
  96 +const fleetLineInfoContainer = ref();
95 97 /**
96 98 * 显示弹窗
97 99 * @param {*} val 工号
... ... @@ -103,16 +105,21 @@ const alterEnterHandler = (val) =&gt; {
103 105 /**
104 106 * 处理容器滚动回调函数
105 107 * @param container HTML parent element
  108 + * @param boxContainerElement HTML parent element
106 109 */
107   -const handleContainerScrollCallBack = (container) => {
108   - if (container.scrollHeight > container.clientHeight) {
109   - // 内容溢出
110   - isScrolling.value = true;
111   - } else {
112   - // 内容未溢出
113   - isScrolling.value = false;
114   - }
115   - props.handleLoadSuccess(false);
  110 +const handleContainerScrollCallBack = (container, boxContainerElement) => {
  111 + let element = container[0];
  112 + let parentLength = element.offsetWidth - 1;
  113 + let styles = window.getComputedStyle(element.firstElementChild);
  114 + let margin = Number(styles.marginRight.substring(0, styles.marginRight.length - 2));
  115 + let childLength = element.firstElementChild.offsetWidth - 1 + margin;
  116 + let elementCount = Math.floor(parentLength / childLength);
  117 + let containerLength = elementCount * childLength;
  118 + let surplus = Math.floor((parentLength - containerLength) / 2) - 1;
  119 + boxContainerElement.forEach(boxElement => {
  120 + boxElement.style.paddingLeft = surplus + "px";
  121 + boxElement.style.paddingRight = surplus + "px";
  122 + });
116 123 }
117 124  
118 125 /**
... ... @@ -126,56 +133,31 @@ const handleWheel = (el) =&gt; {
126 133 // el.preventDefault();
127 134 // 根据滚轮滚动的距离来计算滚动量
128 135 const scrollAmount = el.deltaY > 0 ? 100 : -100;
129   -
130 136 // 修改盒子的滚动位置
131 137 containerElement.scrollTop += scrollAmount;
132   -
133 138 }
134   -
135 139 }
136 140  
137 141 onMounted(() => {
138   - // 处理容器滚动
139   - // nextTick(() => {
140   - // if (containerElement != null) {
141   - // // containerElement.forEach((el) => {
142   - // // const nbbmHaveSaleInfo = el.firstElementChild.firstElementChild;
143   - // // if ("fleet-nbbm-info-have-sale" == nbbmHaveSaleInfo.className) {
144   - // // const textWidth = nbbmHaveSaleInfo.children[1].firstElementChild.offsetWidth;
145   - // // // 有售票员
146   - // // for (let index = 0; index < el.children.length; index++) {
147   - // // const element = el.children[index];
148   - // // element.style.width = `${textWidth}px`;
149   - // // }
150   - // // // 无售票员
151   - // // } else {
152   - // // const textWidth = nbbmHaveSaleInfo.firstElementChild.offsetWidth;
153   - // // for (let index = 0; index < el.children.length; index++) {
154   - // // const element = el.children[index];
155   - // // element.style.width = `${textWidth}px`;
156   - // // }
157   - // // }
158   - // // })
159   - // loading.value = false;
160   - // } else {
161   -
162   - // }
163   - // })
164 142 nextTick(() => {
165   - const containerElement = fleetContentBox.value;
166   - handleContainerScrollCallBack(containerElement);
  143 + const containerElement = fleetNbbmInfoContainer.value;
  144 + const boxContainerElement = fleetLineInfoContainer.value;
  145 + try {
  146 + handleContainerScrollCallBack(containerElement, boxContainerElement);
  147 + } catch (error) {
  148 + console.log("元素为空");
  149 + }
  150 + props.handleLoadSuccess(false);
167 151 })
168 152 })
169 153  
  154 +
170 155 </script>
171 156  
172 157 <style lang="scss" scoped>
173 158 .fleet-content-box {
174 159 height: calc(100% - clamp(0.8rem, -0.907rem + 5.71vw, 1.3rem));
175   - // height: auto;
176 160 width: auto;
177   - // overflow-y: hidden;
178   - // overflow-x: hidden;
179 161 overflow: hidden;
180 162  
181 163 .scrolling {
... ... @@ -210,8 +192,6 @@ onMounted(() =&gt; {
210 192 box-sizing: border-box;
211 193 display: flex;
212 194 flex-wrap: wrap;
213   - justify-content: space-between;
214   - // justify-content: flex-start;
215 195 font-size: 0.8vw;
216 196  
217 197 .fleet-nbbm-info-item {
... ... @@ -219,7 +199,7 @@ onMounted(() =&gt; {
219 199 height: 2.4vh;
220 200 box-sizing: border-box;
221 201 margin-top: 0.4vw;
222   - // margin-right: 0.4vw;
  202 + margin-right: 0.4vw;
223 203 color: black;
224 204  
225 205 .fleet-nbbm-info-have-sale {
... ... @@ -289,46 +269,8 @@ onMounted(() =&gt; {
289 269 }
290 270 }
291 271 }
292   -
293   -
294   -
295   -
296 272 }
297 273 }
298   -
299   -
300   -
301   -/* 定义滚动条样式 */
302   -.fleet-content-box::-webkit-scrollbar {
303   - width: 6px;
304   - height: 6px;
305   -}
306   -
307   -/*定义滑块 内阴影+圆角*/
308   -.fleet-content-box::-webkit-scrollbar-thumb {
309   - border-radius: 6px;
310   - // box-shadow: inset 0 0 0px rgba(237, 44, 37, .5);
311   - background-color: #01366c;
312   - background-image: url('../assets/bigview/scroll-box.png');
313   -}
314   -
315   -/* 设置滚动条拖拽按钮的样式 */
316   -.fleet-content-box::-webkit-scrollbar-thumb:vertical {
317   - background-color: #0761ba;
318   - /* 背景图片的尺寸适应滑块 */
319   - background-size: cover;
320   -}
321   -
322   -.fleet-content-box::-webkit-scrollbar-button {
323   - display: none;
324   -}
325   -
326   -/*定义滚动条轨道 内阴影+圆角*/
327   -.fleet-content-box::-webkit-scrollbar-track {
328   - box-shadow: inset 0 0 0px #01DEDD;
329   - border-radius: 6px;
330   - background-color: #121622;
331   -}
332 274 </style>
333 275 <style>
334 276 .fleet-popover-style {
... ... @@ -338,8 +280,7 @@ onMounted(() =&gt; {
338 280 }
339 281  
340 282 .el-popover.fleet-popover-style {
341   - border-color: #146EBD;
342   - background-color: #062a5ac5;
  283 + border-color: #f4f4f5;
343 284 }
344 285  
345 286 .fleet-popover-style .el-popover__title {
... ... @@ -348,7 +289,7 @@ onMounted(() =&gt; {
348 289 }
349 290  
350 291 .el-popper[data-popper-placement^=top]>.el-popper__arrow::before {
351   - border-top-color: #062a5ac5 !important;
352   - background-color: #062a5ac5 !important;
  292 + border-top-color: rgba(244, 244, 245, 0.735) !important;
  293 + background-color: rgba(244, 244, 245, 0.735) !important;
353 294 }
354 295 </style>
... ...
src/views/home/index.vue
... ... @@ -2,7 +2,7 @@
2 2 <div class="app-container">
3 3 <!-- 可视化大屏 -->
4 4 <div class="box-view" v-loading="loading" element-loading-text="Loading..."
5   - element-loading-svg-view-box="-10, -10, 50, 50" element-loading-background="#081138">
  5 + element-loading-svg-view-box="-10, -10, 50, 50">
6 6 <!-- 标题 -->
7 7 <div class="big-view-container-title">
8 8 <!-- 标题 -->
... ... @@ -19,9 +19,9 @@
19 19 <div class="big-view-container-global-info common-style">
20 20 <div v-for=" (item, index) in globalInfoBoxList" :key="index" class="global-info-box">
21 21 <div class="global-info-box-container">
22   - <div class="global-info-box-container-left">
23   - <!-- <img :src="item.icon" /> -->
24   - </div>
  22 + <!--<div class="global-info-box-container-left">
  23 + <img :src="item.icon" />
  24 + </div>-->
25 25 <div class="global-info-box-container-right">
26 26 <div class="global-info-box-container-right-title">
27 27 {{ item.title }}
... ... @@ -446,6 +446,9 @@ const handleGlobalInfo = (data, num) =&gt; {
446 446 .global-info-box-container-right-number {
447 447 font-weight: bold;
448 448 color: black;
  449 + text-align: center;
  450 + // display: flex;
  451 + // align-items: center;
449 452 }
450 453 }
451 454 }
... ...
src/views/in/in/index.vue
... ... @@ -394,7 +394,7 @@ function handleDelete(row) {
394 394 function handleExport() {
395 395 proxy.download('in/in/export', {
396 396 ...queryParams.value
397   - }, `in_${new Date().getTime()}.xlsx`)
  397 + }, `${queryParams.value.date}打卡记录表.xlsx`)
398 398 }
399 399  
400 400 watch(open, (val1, val2) => {
... ...