diff --git a/src/assets/images/led/header.png b/src/assets/images/led/header.png index 6190be7..1c9e29f 100644 Binary files a/src/assets/images/led/header.png and b/src/assets/images/led/header.png differ diff --git a/src/assets/images/led/headerNew.png b/src/assets/images/led/headerNew.png deleted file mode 100644 index 13a255e..0000000 Binary files a/src/assets/images/led/headerNew.png and /dev/null differ diff --git a/src/views/dataBoard/dataBoard2.vue b/src/views/dataBoard/dataBoard2.vue new file mode 100644 index 0000000..c73f24d --- /dev/null +++ b/src/views/dataBoard/dataBoard2.vue @@ -0,0 +1,965 @@ + + + \ No newline at end of file diff --git a/src/views/led/components/info.vue b/src/views/led/components/info.vue index 2b146af..2dee658 100644 --- a/src/views/led/components/info.vue +++ b/src/views/led/components/info.vue @@ -2,74 +2,51 @@
@@ -104,162 +81,160 @@ export default { height: 100%; position: relative; - .detailHeader { + .deviceDataHeader { position: absolute; - z-index: 3; - width: 232px; - height: 78px; top: 0; left: 0; right: 0; margin: auto; - padding-top: 6px; + width: 200px; + height: 48px; + display: flex; + flex-wrap: nowrap; + justify-content: center; + padding-top: 10px; box-sizing: border-box; - background-image: url("@/assets/images/led/headerNew.png"); - background-repeat: no-repeat; + background-size: contain; background-position: center; - background-size: cover; + background-repeat: no-repeat; + background-image: url("@/assets/images/led/header.png"); + + > div:nth-of-type(1) { + color: #F24439; + width: 22px; + height: 22px; + font-size: 14px; + font-weight: bold; + line-height: 22px; + margin-right: 8px; + border-radius: 50%; + text-align: center; + background-color: #F5F7FB; + } + + > div:nth-of-type(2) { + color: #FFFFFF; + height: 22px; + font-size: 22px; + font-weight: 500; + line-height: 22px; + } + } + + .deviceDataBody { + width: 100%; + height: 250px; + background: linear-gradient(0deg, #1B2E54 0%, #FFFFFF 0%, #FFFFFF 0%, rgba(255,255,255,0) 100%); + + img { + width: 100%; + height: 100%; + } + } + + .deviceDataFooter { + position: absolute; + bottom: 0; + left: 0; + right: 0; + margin: auto; + width: 240px; + height: 120px; + padding: 12px 4px 0; + box-sizing: border-box; + border: 1px solid #FFFFFF; + border-radius: 16px 16px 0 0; + background-color: rgba(255,255,255,0.6); > div:nth-of-type(1) { width: 100%; height: 16px; - color: #FFFFFF; - font-size: 22px; - font-weight: 500; - line-height: 16px; - text-align: center; - margin: 11px 0 8px; - } - - > div:nth-of-type(2) { - color: #FFFFFF; - width: 100%; - height: 14px; - font-size: 14px; - font-weight: bold; - line-height: 14px; - text-align: center; - } - } - - .detailImg { - width: 250px; - height: 250px; - position: relative; - - > div:nth-of-type(1) { - width: 100%; - height: 100%; - - img { - width: 100%; - height: 100%; - } - } - - > div:nth-of-type(2) { - position: absolute; - left: 0; - right: 0; - bottom: 0; - z-index: 2; - width: 100%; - height: 98px; - background: linear-gradient(0deg, #1B2E54 0%, #FFFFFF 0%, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%); - } - } - - .detailFooter { - position: absolute; - z-index: 3; - width: 240px; - height: 160px; - left: 0; - right: 0; - bottom: 0; - margin: auto; - padding-top: 14px; - border-radius: 16px; - box-sizing: border-box; - border: 2px solid #FFFFFF; - background: rgba(238, 246, 253, 0.72); - - .detailFooter-1 { - width: 100%; - height: 26px; display: flex; flex-wrap: nowrap; - align-items: end; - margin-bottom: 14px; justify-content: center; + align-items: center; + margin-bottom: 6px; > div:nth-of-type(1) { - color: #000000; - font-size: 26px; - line-height: 26px; - font-weight: bold; + width: 64px; + height: 2px; + background: linear-gradient(-90deg, #808080 0%, rgba(148,125,255,0) 100%); } > div:nth-of-type(2) { color: #000000; - font-size: 20px; - line-height: 20px; - font-weight: bold; + height: 16px; + padding: 0 10px; + font-size: 16px; + font-weight: 500; + line-height: 16px; + } + + > div:nth-of-type(3) { + width: 64px; + height: 2px; + background: linear-gradient(90deg, #808080 0%, rgba(245,247,251,0) 100%); } } - .detailFooter-2 { + > div:nth-of-type(2) { width: 100%; - height: 32px; + height: 36px; display: flex; + padding: 0 8px; flex-wrap: nowrap; - justify-content: center; + margin-bottom: 8px; + box-sizing: border-box; + justify-content: space-between; + + > div { + height: 36px; + font-size: 36px; + font-weight: bold; + line-height: 36px; + + span { + font-size: 20px; + margin-left: 2px; + font-weight: normal; + } + + &:first-of-type { + color: #F24439; + } + + &:last-of-type { + color: #252535; + } + } + } + + > div:nth-of-type(3) { + width: 100%; + height: 1px; margin-bottom: 10px; + background-color: #EAECF1; + } + + > div:nth-of-type(4) { + width: 100%; + display: flex; + gap: 8px; + flex-wrap: nowrap; + > div { - margin: 0 8px; - height: 32px; - line-height: 30px; color: #2AC79F; - font-size: 16px; - padding: 0 10px; - border-radius: 6px; + height: 24px; + padding: 0 8px; + font-size: 14px; + border-radius: 4px; + line-height: 22px; + box-sizing: border-box; border: 1px solid #2AC79F; background-color: #E5FFF8; } } - - .detailFooter-3 { - width: 100%; - //padding: 0 10px; - box-sizing: border-box; - display: flex; - flex-wrap: wrap; - - > div { - width: 50%; - margin-bottom: 6px; - - > div:nth-of-type(1) { - color: #161616; - height: 26px; - line-height: 26px; - font-size: 24px; - font-weight: bold; - text-align: center; - } - - > div:nth-of-type(2) { - color: #77849E; - height: 16px; - line-height: 16px; - font-weight: 400; - font-size: 16px; - text-align: center; - white-space: nowrap; - } - } - } } } @@ -268,102 +243,158 @@ export default { height: 100%; position: relative; - .detailImg { - width: 250px; - height: 250px; - position: relative; + .deviceDataHeader { + position: absolute; + top: 0; + left: 0; + right: 0; + margin: auto; + width: 200px; + height: 48px; + display: flex; + flex-wrap: nowrap; + justify-content: center; + padding-top: 10px; + box-sizing: border-box; + background-size: contain; + background-position: center; + background-repeat: no-repeat; + background-image: url("@/assets/images/led/header.png"); > div:nth-of-type(1) { - width: 100%; - height: 100%; - background-image: url("@/assets/images/led/null.png"); - background-repeat: no-repeat; - background-position: center; - background-size: cover; + color: #F24439; + width: 22px; + height: 22px; + font-size: 14px; + font-weight: bold; + line-height: 22px; + margin-right: 8px; + border-radius: 50%; + text-align: center; + background-color: #F5F7FB; } > div:nth-of-type(2) { - position: absolute; - left: 0; - right: 0; - bottom: 0; - z-index: 2; - width: 100%; - height: 98px; - background: linear-gradient(0deg, #1B2E54 0%, #FFFFFF 0%, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%); + color: #FFFFFF; + height: 22px; + font-size: 22px; + font-weight: 500; + line-height: 22px; } } - .detailFooter { - position: absolute; - z-index: 3; - width: 245px; - height: 160px; - left: 0; - right: 0; - bottom: 0; - margin: auto; - padding-top: 14px; - border-radius: 16px; - box-sizing: border-box; - border: 2px solid #FFFFFF; - background: rgba(238, 246, 253, 0.72); + .deviceDataBody { + width: 100%; + height: 250px; + background: linear-gradient(0deg, #1B2E54 0%, #FFFFFF 0%, #FFFFFF 0%, rgba(255,255,255,0) 100%); - .detailFooter-1 { + img { width: 100%; height: 100%; + } + } + + .deviceDataFooter { + position: absolute; + bottom: 0; + left: 0; + right: 0; + margin: auto; + width: 240px; + height: 120px; + padding: 12px 4px 0; + box-sizing: border-box; + border: 1px solid #FFFFFF; + border-radius: 16px 16px 0 0; + background-color: rgba(255,255,255,0.6); + + > div:nth-of-type(1) { + width: 100%; + height: 16px; display: flex; flex-wrap: nowrap; - align-items: center; - margin-bottom: 14px; justify-content: center; + align-items: center; + margin-bottom: 6px; - > div { + > div:nth-of-type(1) { + width: 64px; + height: 2px; + background: linear-gradient(-90deg, #808080 0%, rgba(148,125,255,0) 100%); + } + + > div:nth-of-type(2) { color: #000000; - font-size: 26px; - line-height: 26px; - font-weight: bold; + height: 16px; + padding: 0 10px; + font-size: 16px; + font-weight: 500; + line-height: 16px; + } + + > div:nth-of-type(3) { + width: 64px; + height: 2px; + background: linear-gradient(90deg, #808080 0%, rgba(245,247,251,0) 100%); } } - .detailFooter-2 { + > div:nth-of-type(2) { width: 100%; - height: 32px; - margin-bottom: 14px; - } - - .detailFooter-3 { - width: 100%; - height: 100%; - //padding: 0 10px; - box-sizing: border-box; + height: 36px; display: flex; + padding: 0 8px; flex-wrap: nowrap; + margin-bottom: 8px; + box-sizing: border-box; justify-content: space-between; > div { - width: 0; - flex: 1; + height: 36px; + font-size: 36px; + font-weight: bold; + line-height: 36px; - > div:nth-of-type(1) { - color: #161616; - height: 26px; - line-height: 26px; - font-size: 26px; - font-weight: bold; - text-align: center; - margin-bottom: 6px; + span { + font-size: 20px; + margin-left: 2px; + font-weight: normal; } - > div:nth-of-type(2) { - color: #77849E; - height: 16px; - line-height: 16px; - font-weight: 400; - font-size: 14px; - text-align: center; - white-space: nowrap; + &:first-of-type { + color: #F24439; } + + &:last-of-type { + color: #252535; + } + } + } + + > div:nth-of-type(3) { + width: 100%; + height: 1px; + margin-bottom: 10px; + background-color: #EAECF1; + } + + > div:nth-of-type(4) { + width: 100%; + display: flex; + gap: 8px; + flex-wrap: nowrap; + + + > div { + color: #2AC79F; + height: 24px; + padding: 0 8px; + font-size: 14px; + border-radius: 4px; + line-height: 22px; + box-sizing: border-box; + border: 1px solid #2AC79F; + background-color: #E5FFF8; } } } diff --git a/src/views/led/led.vue b/src/views/led/led.vue index 5461a4a..7e8852f 100644 --- a/src/views/led/led.vue +++ b/src/views/led/led.vue @@ -33,186 +33,52 @@ export default { return { url: "https://api.dm.yixiong-tech.com:8443/", screenWidth: 1920, - // deviceDataList: [ - // { - // deviceId: '1', - // data: null - // }, { - // deviceId: '2', - // data: { - // foodId: "2028767531816284161", - // foodName: "蒜香鸡翅根", - // foodImg: "https://dev.yixiong-tech.com:8081/common/files/20260303/ad0b893a-1fa6-4905-b969-016c44cd29b4.png", - // calorie: "116", - // labelList: ['补充蛋白质', '增强免疫力'], - // differenceWeight: "14.88", // 偷菜 - // marginWeight: "5.32", // 余量(kg) - // realNameWeight: "7.86", // 实名取餐重量(kg) - // anonymityWeight: "1.70", // 匿名取餐重量(kg) - // } - // }, { - // deviceId: '3', - // data: null - // }, { - // deviceId: '4', - // data: { - // foodId: "2028273122528030722", - // foodName: "杏鲍菇炒肉", - // foodImg: "https://dev.yixiong-tech.com:8081/common/files/20260302/a0c9541a-47bb-43db-bff5-053fe3d88111.png", - // calorie: "59", - // labelList: ['润肠通便', '提高免疫'], - // differenceWeight: "12.50", // 偷菜 - // marginWeight: "6.18", // 余量(kg) - // realNameWeight: "5.42", // 实名取餐重量(kg) - // anonymityWeight: "0.90", // 匿名取餐重量(kg) - // } - // }, { - // deviceId: '5', - // data: null - // }, { - // deviceId: '6', - // data: { - // foodId: "2029388232071933954", - // foodName: "青椒鸡肉丝", - // foodImg: "https://dev.yixiong-tech.com:8081/common/files/20260305/8e833968-f88b-4918-84d0-99dcc5118b4b.png", - // calorie: "43", - // labelList: ['促进消化', '补充维C'], - // differenceWeight: "11.92", // 偷菜 - // marginWeight: "4.56", // 余量(kg) - // realNameWeight: "6.24", // 实名取餐重量(kg) - // anonymityWeight: "1.12", // 匿名取餐重量(kg) - // } - // }, { - // deviceId: '7', - // data: null - // }, { - // deviceId: '8', - // data: { - // foodId: "2028277177375617026", - // foodName: "西红柿炒鸡蛋", - // foodImg: "https://dev.yixiong-tech.com:8081/common/files/20260302/660cc729-09cc-4b77-bfe9-9d2918714a3c.png", - // calorie: "44", - // labelList: ['美容养颜', '健脑益智'], - // differenceWeight: "15.00", // 偷菜 - // marginWeight: "3.74", // 余量(kg) - // realNameWeight: "8.96", // 实名取餐重量(kg) - // anonymityWeight: "2.30", // 匿名取餐重量(kg) - // } - // }, { - // deviceId: '9', - // data: null - // }, { - // deviceId: '10', - // data: { - // foodId: "2028768323575050242", - // foodName: "凉拌菠菜", - // foodImg: "https://dev.yixiong-tech.com:8081/common/files/20260303/af27cd5a-325f-4d9c-bedf-4b32870f293c.png", - // calorie: "30", - // labelList: ['补铁补血', '明目护眼'], - // differenceWeight: "12.14", // 偷菜 - // marginWeight: "7.20", // 余量(kg) - // realNameWeight: "4.38", // 实名取餐重量(kg) - // anonymityWeight: "0.56", // 匿名取餐重量(kg) - // } - // }, { - // deviceId: '11', - // data: null - // }, { - // deviceId: '12', - // data: { - // foodId: "2031257721365442561", - // foodName: "青笋炒木耳?", - // foodImg: "https://dev.yixiong-tech.com:8081/common/files/20260310/45e6f7fc-f58a-4828-b5ff-72c5a5f561da.png", - // calorie: "28", - // labelList: ['清热解毒', '活血化瘀'], - // differenceWeight: "10.50", // 偷菜 - // realNameWeight: "3.82", // 实名取餐重量(kg) - // marginWeight: "5.94", // 余量(kg) - // anonymityWeight: "0.74", // 匿名取餐重量(kg) - // } - // }, { - // deviceId: '13', - // data: null - // }, { - // deviceId: '14', - // data: { - // foodId: "2031248239226892289", - // foodName: "玉米粒大米饭", - // foodImg: "https://dev.yixiong-tech.com:8081/common/files/20260306/db3b1d29-8a8d-4e26-a93f-fdc066959f30.png", - // calorie: "137", - // labelList: ['补充能量', '促进消化'], - // differenceWeight: "20.00", - // marginWeight: "8.64", // 余量(kg) - // realNameWeight: "10.26", // 实名取餐重量(kg) - // anonymityWeight: "1.10", // 匿名取餐重量(kg) - // } - // }, { - // deviceId: '15', - // data: null - // }], - deviceDataList: [], - initDeviceDataList: [ - { - deviceId: '1', - data: null - }, - { - deviceId: '2', - data: null - }, - { - deviceId: '3', - data: null - }, - { - deviceId: '4', - data: null - }, - { - deviceId: '5', - data: null - }, - { - deviceId: '6', - data: null - }, - { - deviceId: '7', - data: null - }, - { - deviceId: '8', - data: null - }, - { - deviceId: '9', - data: null - }, - { - deviceId: '10', - data: null - }, - { - deviceId: '11', - data: null - }, - { - deviceId: '12', - data: null - }, - { - deviceId: '13', - data: null - }, - { - deviceId: '14', - data: null - }, - { - deviceId: '15', - data: null - }, - ], + deviceDataList: [{ + deviceId: '1', + data: null + }, { + deviceId: '2', + data: null + }, { + deviceId: '3', + data: null + }, { + deviceId: '4', + data: null + }, { + deviceId: '5', + data: null + }, { + deviceId: '6', + data: null + }, { + deviceId: '7', + data: null + }, { + deviceId: '8', + data: null + }, { + deviceId: '9', + data: null + }, { + deviceId: '10', + data: null + }, { + deviceId: '11', + data: null + }, { + deviceId: '12', + data: null + }, { + deviceId: '13', + data: null + }, { + deviceId: '14', + data: null + }, { + deviceId: '15', + data: null + }], } }, mounted() { @@ -227,35 +93,38 @@ export default { }, methods: { getInfoByDeviceId(deviceIdInfo) { - if (deviceIdInfo.deviceId === 'all') { - this.initData(); - } else { - let _this = this; - if (!deviceIdInfo.deviceId) return; - httpRequest("GET", this.url+'terminal/neglect/large-screen/longScreen/device' , {deviceId: deviceIdInfo.deviceId}, {"authorization": "57ee87183f2a4fa59683ec9ef41c8f5d"}) - .then((res) => { - if (res.code === '00000') { - let data = JSON.parse(JSON.stringify(_this.deviceDataList)); - let count = -1; - for (let i = 0; i < data.length; i++) { - if (data[i].deviceId === deviceIdInfo.deviceId) { - count = i; - break; - } - } - if (count !== -1) { - _this.deviceDataList.splice(count, 1, {deviceId: deviceIdInfo.deviceId, data: res.data}); - } - } - }) - .catch((err) => { - console.log(err) - }) - } + // if (deviceIdInfo.deviceId === 'all') { + // this.initData(); + // } else { + // let _this = this; + // if (!deviceIdInfo.deviceId) return; + // httpRequest("GET", this.url + 'terminal/neglect/large-screen/longScreen/device', {deviceId: deviceIdInfo.deviceId}, {"authorization": "57ee87183f2a4fa59683ec9ef41c8f5d"}) + // .then((res) => { + // if (res.code === '00000') { + // let data = JSON.parse(JSON.stringify(_this.deviceDataList)); + // let count = -1; + // for (let i = 0; i < data.length; i++) { + // if (data[i].deviceId === deviceIdInfo.deviceId) { + // count = i; + // break; + // } + // } + // if (count !== -1) { + // _this.deviceDataList.splice(count, 1, { + // deviceId: deviceIdInfo.deviceId, + // data: res.data + // }); + // } + // } + // }) + // .catch((err) => { + // console.log(err) + // }) + // } }, initData() { let _this = this; - httpRequest("GET", this.url+'terminal/neglect/large-screen/longScreen', {}, {"authorization": "57ee87183f2a4fa59683ec9ef41c8f5d"}).then(function (res) { + httpRequest("GET", this.url + 'terminal/neglect/large-screen/longScreen', {}, {"authorization": "57ee87183f2a4fa59683ec9ef41c8f5d"}).then(function (res) { if (res?.code === '00000') { _this.deviceDataList = res?.data?.foodList ? res?.data?.foodList.map((item, index) => { return { @@ -263,17 +132,21 @@ export default { data: item.foodName ? item : null } }) : _this.initDeviceDataList; - } else { + } else { _this.deviceDataList = _this.initDeviceDataList } console.log(_this.deviceDataList); - }).catch(function(err) { + }).catch(function (err) { console.log(err) _this.deviceDataList = _this.initDeviceDataList }) }, initMttqF() { - initMqtt('deviceId-' + Math.random().toString(16).substring(2, 8),'yx/device/foodRecord/needUpdate','led', {username: process.env.VUE_APP_LED_MQTT_USERNAME, password: process.env.VUE_APP_LED_MQTT_PASSWORD, head: 'wss'}) + initMqtt('deviceId-' + Math.random().toString(16).substring(2, 8), 'yx/device/foodRecord/needUpdate', 'led', { + username: process.env.VUE_APP_LED_MQTT_USERNAME, + password: process.env.VUE_APP_LED_MQTT_PASSWORD, + head: 'wss' + }) .then((res) => { console.log(res) })