Ver código fonte

样式调整

zy1125 1 ano atrás
pai
commit
3902cd1124

+ 31 - 36
src/assets/css/home.scss

@@ -28,51 +28,46 @@
28
 // 点击模型弹出框
28
 // 点击模型弹出框
29
 .modelInfo {
29
 .modelInfo {
30
     position: absolute;
30
     position: absolute;
31
-    padding: 10px;
32
-    padding-left: 20px;
33
-    border-radius: 10px;
34
     background: rgba(255, 255, 255, 0.17);
31
     background: rgba(255, 255, 255, 0.17);
35
-    width: 206px;
36
-    height: 165px;
37
-    display: none;
32
+    border-radius: 10px;
38
     backdrop-filter: blur(30.5px);
33
     backdrop-filter: blur(30.5px);
39
-    z-index: 888;
34
+    z-index: 9988;
40
 
35
 
41
-    .model-detail {
42
-        position: absolute;
43
-        // border: 2px dashed #00CF78;
44
-        display: none;
36
+    // .model-detail {
37
+    //     position: absolute;
38
+    //     // border: 2px dashed #00CF78;
39
+    //     display: none;
45
 
40
 
46
-        display: flex;
47
-        justify-content: space-between;
48
-        flex-direction: column;
49
-        // flex-wrap: wrap;
50
-        // padding: 10px;
41
+    //     display: flex;
42
+    //     justify-content: space-between;
43
+    //     flex-direction: column;
44
+    //     // flex-wrap: wrap;
45
+    //     // padding: 10px;
51
 
46
 
52
 
47
 
53
-        span {
54
-            font-size: 16px;
48
+    //     span {
49
+    //         font-size: 16px;
55
 
50
 
56
-            width: 100%;
57
-            font-family: Microsoft YaHei UI;
51
+    //         width: 100%;
52
+    //         font-family: Microsoft YaHei UI;
58
 
53
 
59
-            // border: 1px solid red;
60
-            // margin: 6px;
61
-            margin: 6px 0;
62
-            font-weight: 400;
54
+    //         // border: 1px solid red;
55
+    //         // margin: 6px;
56
+    //         margin: 6px 0;
57
+    //         font-weight: 400;
63
 
58
 
64
-            .title {
65
-                color: #333;
66
-                font-weight: 700;
67
-            }
59
+    //         .title {
60
+    //             color: #333;
61
+    //             font-weight: 700;
62
+    //         }
68
 
63
 
69
-            .green {
70
-                color: #00C767;
71
-            }
64
+    //         .green {
65
+    //             color: #00C767;
66
+    //         }
72
 
67
 
73
-            .red {
74
-                color: #DB4A36;
75
-            }
76
-        }
77
-    }
68
+    //         .red {
69
+    //             color: #DB4A36;
70
+    //         }
71
+    //     }
72
+    // }
78
 }
73
 }

+ 17 - 6
src/components/CircleProgress.vue

@@ -13,7 +13,7 @@
13
             <circle r="38" cx="48" cy="48" fill="none" stroke-miterlimit="20" stroke-width="4" class="svg-progress"
13
             <circle r="38" cx="48" cy="48" fill="none" stroke-miterlimit="20" stroke-width="4" class="svg-progress"
14
                 style="stroke-dasharray: 275, 279.602; stroke: rgba(255, 255, 255, 0.19)"></circle>
14
                 style="stroke-dasharray: 275, 279.602; stroke: rgba(255, 255, 255, 0.19)"></circle>
15
             <circle r="38" transform="rotate(180 48 48)" cx="48" cy="48" fill="none" stroke-miterlimit="20" stroke-width="4"
15
             <circle r="38" transform="rotate(180 48 48)" cx="48" cy="48" fill="none" stroke-miterlimit="20" stroke-width="4"
16
-                class="svg-progress" :style="`stroke-dasharray: ${progressValue}, 279.602;stroke:${color};`"></circle>
16
+                class="svg-progress" :style="`stroke-dasharray: 240, 279.602;stroke:${color};`"></circle>
17
         </svg>
17
         </svg>
18
         <div class="mask">
18
         <div class="mask">
19
             <slot></slot>
19
             <slot></slot>
@@ -21,16 +21,19 @@
21
     </div>
21
     </div>
22
 
22
 
23
     <div class="bottomNumber" v-if="textPosition == 'bottom'">
23
     <div class="bottomNumber" v-if="textPosition == 'bottom'">
24
-        <ul class="flex">
24
+        <ul class="flex" style="width: 65px;display: flex;align-items: center;justify-content: center;">
25
             <!-- <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" /> -->
25
             <!-- <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" /> -->
26
-            <count-to :useEasing="false" style="font-size: 0.08rem;"  :startVal='1' :endVal='targetValue' :duration='2000'></count-to>
27
-            <span> (人)</span>
26
+            <div style="color: #fff;font-weight: 600; ">
27
+                <count-to :useEasing="false" style="font-size: 0.08rem;"  :startVal='1' :endVal='targetValue' :duration='2000'></count-to>
28
+            </div>
29
+            <span style="color: antiquewhite;"   v-if="text.includes('课程')">(节)</span>
30
+            <span style="color: antiquewhite;" v-else>(个)</span>
28
         </ul>
31
         </ul>
29
 
32
 
30
     </div>
33
     </div>
31
 </template>
34
 </template>
32
 <script setup lang="ts">
35
 <script setup lang="ts">
33
-import { ref, computed, toRefs, watch, onMounted } from 'vue';
36
+import { ref, computed, toRefs, watch, onMounted,reactive  } from 'vue';
34
 import ScrollNum from './roll.vue';
37
 import ScrollNum from './roll.vue';
35
 import { CountTo } from 'vue3-count-to';
38
 import { CountTo } from 'vue3-count-to';
36
 
39
 
@@ -44,6 +47,10 @@ const props = defineProps({
44
         type: String,
47
         type: String,
45
         default: '#4c7cee',
48
         default: '#4c7cee',
46
     },
49
     },
50
+    text: {
51
+        type: String,
52
+        default: -1,
53
+    },
47
     width: {
54
     width: {
48
         type: String,
55
         type: String,
49
         default: '54.6px',
56
         default: '54.6px',
@@ -58,7 +65,7 @@ const props = defineProps({
58
         default: 'top',
65
         default: 'top',
59
     }
66
     }
60
 });
67
 });
61
-const { height, width, color, targetValue, textPosition } = toRefs(props);
68
+const { height, width, color, targetValue, textPosition,text } = toRefs(props);
62
 
69
 
63
 // let showProgress = ref<number>(0);
70
 // let showProgress = ref<number>(0);
64
 const numArr = computed(() => {
71
 const numArr = computed(() => {
@@ -98,6 +105,8 @@ const circleValue = () => {
98
 
105
 
99
 onMounted(() => {
106
 onMounted(() => {
100
     circleValue()
107
     circleValue()
108
+
109
+ 
101
 })
110
 })
102
 
111
 
103
 // const progressValue = ref(0)
112
 // const progressValue = ref(0)
@@ -105,6 +114,8 @@ watch(textPosition, (newValue) => {
105
     console.log("监听一下现在的位置", newValue)
114
     console.log("监听一下现在的位置", newValue)
106
     // progressValue.value = 360;
115
     // progressValue.value = 360;
107
 });
116
 });
117
+
118
+
108
 </script>
119
 </script>
109
 <style lang="scss" scoped>
120
 <style lang="scss" scoped>
110
 .progress {
121
 .progress {

+ 36 - 24
src/components/home.vue

@@ -10,15 +10,24 @@
10
             </div>
10
             </div>
11
 
11
 
12
         </el-container>
12
         </el-container>
13
-        <div ref="popoverRef" id="popoverRef" class="modelInfo">
14
-            <div class="model-detail">
15
-                <span v-for="item in classDeviceInfo">
16
-
17
-                    <span class="title">{{ item && item.name }}: </span>
18
-                    <span :class="item.online ? 'green' : item.online == 'false' ? 'red' : ''">{{ item && item.value }}
19
-                    </span>
20
-
21
-                </span>
13
+        <div ref="popoverRef" id="popoverRef" class="modelInfo" >
14
+            <div class="model-detail" >
15
+                <div v-for="item in classDeviceInfo"  style="margin-bottom: 5px;">
16
+                    
17
+                    <div style="width: 180px;text-align: center;height: 30px;line-height: 30px;font-size: 12px;color: #fff; background-color: #49484890;: blur(20px);">
18
+                    {{ item[0].value }}
19
+                    </div>
20
+                    <div v-for="item2 in item"  style="width: 180px;height: 30px;display: flex;align-items: center;">
21
+                        
22
+                       <span style="color: #fff;margin-left: 5px; font-weight: 700;"> {{ item2.name }} :</span>
23
+                       <span v-if="item2.value!='在线'" style=" font-family: 100; margin-left: 5px;color: #ffffffeb;">{{ item2.value }}</span>
24
+                       <span v-else style=" font-family: 100; margin-left: 5px;color: #10C383;">{{ item2.value }}</span>
25
+                    </div>
26
+                   
27
+                    <!-- <span :class="item.online ? 'green' : item.online == 'false' ? 'red' : ''">213
28
+                    </span> -->
29
+
30
+                </div>
22
             </div>
31
             </div>
23
         </div>
32
         </div>
24
 
33
 
@@ -144,13 +153,13 @@ export default ({
144
         })
153
         })
145
         const classDeviceInfo = ref([])
154
         const classDeviceInfo = ref([])
146
         const classDataLoaded = ref(false)
155
         const classDataLoaded = ref(false)
147
-        const classDevice = async function (deviceCode) {
148
-            let res = await getClassDetail(deviceCode)
149
-            console.log("获取到了当前点击物体得详情", res)
150
-            classDeviceInfo.value = res.data;
151
-            classDataLoaded.value = true
156
+        // const classDevice = async function (deviceCode) {
157
+        //     let res = await getClassDetail(deviceCode)
158
+        //     console.log("获取到了当前点击物体得详情", res)
159
+        //     classDeviceInfo.value = res.data;
160
+        //     classDataLoaded.value = true
152
 
161
 
153
-        }
162
+        // }
154
         const clickData1 = ref({})
163
         const clickData1 = ref({})
155
         const mouseClick = function (e) {
164
         const mouseClick = function (e) {
156
             // console.log("屏幕点击位置看", e)
165
             // console.log("屏幕点击位置看", e)
@@ -186,15 +195,18 @@ export default ({
186
                 console.log('sadasd',json.deviceCode);
195
                 console.log('sadasd',json.deviceCode);
187
                 let replacedStr = json.deviceCode.replace("/", "A");
196
                 let replacedStr = json.deviceCode.replace("/", "A");
188
                 getClassDetail(replacedStr).then(res => {
197
                 getClassDetail(replacedStr).then(res => {
198
+                    console.log('sad21312',res);
189
                     classDeviceInfo.value = res.data;
199
                     classDeviceInfo.value = res.data;
190
-                    classDeviceInfo.value.map(i => {
191
-                        if (i.value == "在线") {
192
-                            i.online = true
193
-                        }
194
-                        if (i.value == "离线") {
195
-                            i.online = false
196
-                        }
197
-                    })
200
+
201
+                    console.log('asd2121',classDeviceInfo.value);
202
+                    // classDeviceInfo.value.map(i => {
203
+                    //     if (i.value == "在线") {
204
+                    //         i.online = true
205
+                    //     }
206
+                    //     if (i.value == "离线") {
207
+                    //         i.online = false
208
+                    //     }
209
+                    // })
198
                     console.log("json.y ", json,);
210
                     console.log("json.y ", json,);
199
                     linedomRef.value.style.top = (clickData.value.y) + "px";
211
                     linedomRef.value.style.top = (clickData.value.y) + "px";
200
                     linedomRef.value.style.left = (clickData.value.x) + "px";
212
                     linedomRef.value.style.left = (clickData.value.x) + "px";
@@ -214,7 +226,7 @@ export default ({
214
                             popoverRef.value.style.left = (json.x - 120) + 'px'
226
                             popoverRef.value.style.left = (json.x - 120) + 'px'
215
                             break;
227
                             break;
216
                         case "Right":
228
                         case "Right":
217
-                            popoverRef.value.style.top = (Number(json.y)) + 'px'
229
+                            popoverRef.value.style.top = (Number(json.y)) -100+ 'px'
218
                             popoverRef.value.style.left = Number(json.x) + 100 + 'px'
230
                             popoverRef.value.style.left = Number(json.x) + 100 + 'px'
219
 
231
 
220
                             break;
232
                             break;

+ 1 - 1
src/components/left.vue

@@ -25,7 +25,7 @@
25
             </div>
25
             </div>
26
             <div class="content">
26
             <div class="content">
27
                 <div class="count" v-for="(item, index) in classCount" :key="index">
27
                 <div class="count" v-for="(item, index) in classCount" :key="index">
28
-                    <CircleProgress :target-value="item.number" :color="item.color" text-position="bottom">
28
+                    <CircleProgress :target-value="item.number" :color="item.color" :text="item.text" text-position="bottom">
29
                         <img :src="leftimg + item.imgnumber + '.png'" alt="">
29
                         <img :src="leftimg + item.imgnumber + '.png'" alt="">
30
                     </CircleProgress>
30
                     </CircleProgress>
31
                     <div class="text">{{ item.text }}</div>
31
                     <div class="text">{{ item.text }}</div>

+ 4 - 1
src/components/right.vue

@@ -156,12 +156,15 @@ export default ({
156
         //获取页面数据
156
         //获取页面数据
157
         const getDeviceData = async () => {
157
         const getDeviceData = async () => {
158
             let res = await getDevice()
158
             let res = await getDevice()
159
+            console.log('s12312123',res);
159
             if (res.code !== 200) {
160
             if (res.code !== 200) {
160
                 ElMessage.error("数据请求出错");
161
                 ElMessage.error("数据请求出错");
161
             }
162
             }
162
             let { category, monitor, status } = res.data
163
             let { category, monitor, status } = res.data
163
             // 物联设备类型数据
164
             // 物联设备类型数据
164
-            interDevice.value = category;
165
+            console.log('sadui12u31',category);
166
+            //截取数组前6项
167
+            interDevice.value = category.slice(0,6);
165
             // 互动教室
168
             // 互动教室
166
             carouselData.value = monitor
169
             carouselData.value = monitor
167
             //物联设备统计
170
             //物联设备统计