diff --git a/mock/common.ts b/mock/common.ts new file mode 100644 index 0000000..e80e04c --- /dev/null +++ b/mock/common.ts @@ -0,0 +1,22 @@ +/* + * @Author: donghao donghao@supervision.ltd + * @Date: 2025-03-11 11:29:02 + * @LastEditors: donghao donghao@supervision.ltd + * @LastEditTime: 2025-08-19 11:39:52 + * @FilePath: \5G-Loading-Bay-Web\mock\poleMonitor.ts + * @Description: 撑杆监测 + */ +import { MockMethod } from "vite-plugin-mock"; +import { poleMonitorListData, fileListData } from "./pools/commonData"; +import { fetchCurrPageByList, fetchMockSuccessFullByOther } from "./utils/apiMock"; + +export default [ + { + url: "/api/v1/record/generator_result/", + method: "post", + response: req => { + // console.log(req); + return {...fetchMockSuccessFullByOther(fileListData)} + } + } +] as MockMethod[]; \ No newline at end of file diff --git a/mock/pools/commonData.ts b/mock/pools/commonData.ts new file mode 100644 index 0000000..600aa29 --- /dev/null +++ b/mock/pools/commonData.ts @@ -0,0 +1,80 @@ +/* + * @Author: donghao donghao@supervision.ltd + * @Date: 2025-03-11 11:30:09 + * @LastEditors: donghao donghao@supervision.ltd + * @LastEditTime: 2025-08-19 17:35:17 + * @FilePath: \5G-Loading-Bay-Web\mock\pools\poleMonitorData.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import Mock from "mockjs"; +import { isImage } from "../utils/is"; +const fileUrls = [ + "https://t7.baidu.com/it/u=72176654,472254471&fm=193", + "https://img2.baidu.com/it/u=1319203967,453193481&fm=253&fmt=auto&app=120&f=JPEG?w=1023&h=685", + "https://img2.baidu.com/it/u=1876217523,3868046800&fm=253&fmt=auto&app=120&f=JPEG?w=1200&h=800", + "https://picx.zhimg.com/v2-a8b8217d6aad02940be44a657cb55a99_r.jpg?source=1940ef5c", + "https://img0.baidu.com/it/u=108226426,371429720&fm=253&fmt=auto&app=138&f=JPEG?w=749&h=500", + "https://img1.baidu.com/it/u=967792105,51180745&fm=253&fmt=auto?w=1200&h=800", + "https://picx.zhimg.com/v2-026d3f92c9984a21dc217018d3b228a7_r.jpg?source=1def8aca", +]; +const mockListData = Mock.mock({ + // 生成 10 条数据,可以根据需要调整数量 + "data|140": [ + { + // 车号,生成随机的 4 位字母和数字组合 + train_number: /[A-Z0-9]{10}/, + // 车型,从预定义的数组中随机选择一个 + train_model: () => Mock.Random.pick(["轿车", "SUV", "客车", "货车"]), + // 车厢号,生成 1 到 10 的随机整数 + "train_carriage_number|1-10": 1, + // 告警类型,从预定义的数组中随机选择一个 + alarm_type: () => + Mock.Random.pick(["超速告警", "碰撞告警", "低电量告警"]), + // 故障类型,从预定义的数组中随机选择一个 + faultType: () => Mock.Random.pick(["撑杆弯曲", "撑杆断折"]), + // 等级,生成 1 到 3 的随机整数 + "level|1-3": 1, + // 复核,随机生成 '是' 或 '否' + is_reviewed: () => Mock.Random.pick([true, false]), + // 时间,生成过去一个月内的随机日期和时间 + created_at: () => + Mock.Random.date("yyyy-MM-dd") + " " + Mock.Random.time("HH:mm:ss"), + }, + ], +}); + +const mockFilesData = Mock.mock({ + [`list|${fileUrls.length}`]: [ + { + "id|+1": 10, + key: "@id", + name: "@animal", + image_url: function () { + // 依次取出视频链接 + const currFile = fileUrls[this.id - 10]; + return fileUrls[this.id - 10]; + return null; + }, + created_at: '@datetime("yyyy-MM-dd HH:mm:ss")', + updated_at: '@datetime("yyyy-MM-dd HH:mm:ss")', + length: "@float(0.1, 10, 2, 2)", + width: "@float(0.1, 10, 2, 2)", + height: "@float(0.1, 10, 2, 2)", + weight: "@float(0.1, 1000, 1, 2)", + volume: function () { + return (this.length * this.width * this.height).toFixed(2); + }, + record: 1, + }, + ], +}); + +// console.log(mockListData, 'mockListData'); +const currentData = mockListData.data; +const currentFilesData = mockFilesData.list; + +export const fileListData = { + data: { + data: currentFilesData, + }, +}; diff --git a/src/assets/common/dialog_video_export_bg.png b/src/assets/common/dialog_video_export_bg.png new file mode 100644 index 0000000..5925052 Binary files /dev/null and b/src/assets/common/dialog_video_export_bg.png differ diff --git a/src/assets/common/generator_video_btn_icon.png b/src/assets/common/generator_video_btn_icon.png new file mode 100644 index 0000000..158e350 Binary files /dev/null and b/src/assets/common/generator_video_btn_icon.png differ diff --git a/src/assets/common/generator_video_icon.png b/src/assets/common/generator_video_icon.png new file mode 100644 index 0000000..cffccef Binary files /dev/null and b/src/assets/common/generator_video_icon.png differ diff --git a/src/assets/common/no_data.png b/src/assets/common/no_data.png new file mode 100644 index 0000000..040b5ed Binary files /dev/null and b/src/assets/common/no_data.png differ diff --git a/src/components/Swiper/swiperFile.vue b/src/components/Swiper/swiperFile.vue new file mode 100644 index 0000000..26c8701 --- /dev/null +++ b/src/components/Swiper/swiperFile.vue @@ -0,0 +1,169 @@ + + + + + + + diff --git a/src/components/Swiper/swiperPlayer.vue b/src/components/Swiper/swiperPlayer.vue new file mode 100644 index 0000000..0a81f00 --- /dev/null +++ b/src/components/Swiper/swiperPlayer.vue @@ -0,0 +1,62 @@ + + + + diff --git a/src/styles/common.scss b/src/styles/common.scss index 265661b..b6f6eb8 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -94,7 +94,7 @@ color: white; margin-left: 0; height: 32px; - & .icon { + .icon { width: 14px; height: 14px; background-image: url("@/assets/common/search_icon.png"); @@ -148,6 +148,7 @@ width: 1202px; height: 602px; background-image: url("@/assets/common/dialog_bg2.png"); + background-size: 100% 100%; } .fg-dialog-header-close { width: 50px; @@ -167,9 +168,43 @@ background-color: transparent; background-image: url("@/assets/common/dialog_head_bg.png"); background-repeat: no-repeat; + // 左侧标题带图标 + .fg-dialog-header-icon-title { + padding: 0 24px; + font-weight: bold; + font-size: 18px; + .header-icon { + width: 24px; + height: 48px; + margin-right: 12px; + background-image: url("@/assets/common/alarm_title.png"); + background-size: contain; + background-position: center; + background-repeat: no-repeat; + } + .header-text { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + max-width: 650px; + } + } } } +// 左侧带边框的标题 +.fg-border-left-title { + // box-sizing: border-box; + padding-left: 8px; + height: 22px; + font-weight: bold; + font-size: 14px; + color: #ffffff; + border-left: 3px solid; + border-image: linear-gradient(180deg, #2589ff 0%, #46a9ed 100%) 1; + line-height: 22px; +} + // 外观、撑杆、钩机(监测)底部图表 .fg-footer-charts { display: flex; @@ -205,6 +240,29 @@ } } } + +// 空数据 +.fg-no-data { + width: 100%; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + .bg-no-data { + width: 63px; + background-image: url("@/assets/common/no_data.png"); + background-size: contain; + height: 58px; + background-position: center; + background-repeat: no-repeat; + } + .no-data-text { + padding-top: 16px; + font-size: 14px; + color: #999999; + } +} .fg-empty-image { width: 100%; height: 100%; diff --git a/src/views/dashboard/AppearanceMonitor.vue b/src/views/dashboard/AppearanceMonitor.vue index 1cdde96..c34cbcb 100644 --- a/src/views/dashboard/AppearanceMonitor.vue +++ b/src/views/dashboard/AppearanceMonitor.vue @@ -290,7 +290,7 @@ onMounted(() => {
- +
diff --git a/src/views/dashboard/DiggerMonitor.vue b/src/views/dashboard/DiggerMonitor.vue index 187caff..cdf15d5 100644 --- a/src/views/dashboard/DiggerMonitor.vue +++ b/src/views/dashboard/DiggerMonitor.vue @@ -4,6 +4,8 @@ import { BaseDelete, BaseTable } from "@/components/CustomTable"; import DiggerAlarmModal from "./components/DiggerAlarmModal.vue"; import DiggerHourlyDistanceChart from "@/components/Charts/diggerHourlyDistanceChart.vue"; import DiggerDailyDistanceChart from "@/components/Charts/diggerDailyDistanceChart.vue"; +import VideoExport from "./components/VideoExport.vue"; + import { getAppearanceMonitorApi, getAppearanceMonitorDetailApi, @@ -226,9 +228,10 @@ onMounted(() => {
- - +
@@ -333,7 +341,7 @@ onMounted(() => {
-