diff --git a/package.json b/package.json index da7f9f3..da5261a 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "pinia": "2.1.7", "splitpanes": "3.1.5", "unocss": "^0.65.1", + "video.js": "^8.23.4", "vue": "3.4.31", "vue-cropper": "1.1.1", "vue-router": "4.4.0" @@ -42,7 +43,7 @@ "@iconify-json/carbon": "^1.2.5", "@iconify/vue": "^4.2.0", "@vitejs/plugin-vue": "5.0.5", - "sass-embedded": "^1.83.4", + "sass-embedded": "^1.93.2", "unplugin-auto-import": "0.17.6", "unplugin-vue-setup-extend-plus": "1.0.1", "vite": "5.3.2", diff --git a/src/assets/styles/variables.module.scss b/src/assets/styles/variables.module.scss index ffac6d5..954a144 100644 --- a/src/assets/styles/variables.module.scss +++ b/src/assets/styles/variables.module.scss @@ -1,4 +1,4 @@ -@import './variables.scss'; +@import './variables_custom.scss'; :export { menuText: $menuText; diff --git a/src/assets/styles/variables.scss b/src/assets/styles/variables_custom.scss similarity index 100% rename from src/assets/styles/variables.scss rename to src/assets/styles/variables_custom.scss diff --git a/src/main.js b/src/main.js index e7ba3db..c65390e 100644 --- a/src/main.js +++ b/src/main.js @@ -1,3 +1,9 @@ +/* + * @Author: chris + * @Date: 2025-01-13 09:34:10 + * @LastEditors: chris + * @LastEditTime: 2025-10-27 14:19:18 + */ import { createApp } from "vue"; import Cookies from "js-cookie"; @@ -7,6 +13,7 @@ import "element-plus/dist/index.css"; import "element-plus/theme-chalk/dark/css-vars.css"; import locale from "element-plus/es/locale/lang/zh-cn"; import "virtual:uno.css"; +import "video.js/dist/video-js.css"; import "@/assets/styles/index.scss"; // global css diff --git a/src/utils/index.js b/src/utils/index.js index c800c9c..0282594 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -396,3 +396,33 @@ export function isNumberStr(str) { export function objectToArray(obj) { return Object.keys(obj).map((key) => obj[key]); } + +/** + * 随机生成暗色 + * 确保生成的颜色不是亮色,通过控制RGB值在较低范围内 + * @returns {string} 十六进制颜色代码 + */ +export function getRandomColor() { + // 生成0-255之间的随机RGB值 + const r = Math.floor(Math.random() * 255); + const g = Math.floor(Math.random() * 255); + const b = Math.floor(Math.random() * 255); + + // 转换为十六进制并格式化 + const toHex = (value) => { + const hex = value.toString(16); + return hex.length === 1 ? "0" + hex : hex; + }; + + return "#" + toHex(r) + toHex(g) + toHex(b); +} + +export function getDateRange(days) { + const endDate = new Date(); + const startDate = new Date(endDate); + startDate.setDate(endDate.getDate() - days); + return { + beginTime: startDate.toISOString().split("T")[0], + endTime: endDate.toISOString().split("T")[0], + }; +} diff --git a/src/views/device/components/ActionButtons.vue b/src/views/devices/components/ActionButtons.vue similarity index 100% rename from src/views/device/components/ActionButtons.vue rename to src/views/devices/components/ActionButtons.vue diff --git a/src/views/device/components/PestFormDialog.vue b/src/views/devices/components/PestFormDialog.vue similarity index 100% rename from src/views/device/components/PestFormDialog.vue rename to src/views/devices/components/PestFormDialog.vue diff --git a/src/views/device/components/PestSearchForm.vue b/src/views/devices/components/PestSearchForm.vue similarity index 100% rename from src/views/device/components/PestSearchForm.vue rename to src/views/devices/components/PestSearchForm.vue diff --git a/src/views/device/components/PestTable.vue b/src/views/devices/components/PestTable.vue similarity index 100% rename from src/views/device/components/PestTable.vue rename to src/views/devices/components/PestTable.vue diff --git a/src/views/device/components/PestViewDialog.vue b/src/views/devices/components/PestViewDialog.vue similarity index 100% rename from src/views/device/components/PestViewDialog.vue rename to src/views/devices/components/PestViewDialog.vue diff --git a/src/views/device/config.js b/src/views/devices/config.js similarity index 100% rename from src/views/device/config.js rename to src/views/devices/config.js diff --git a/src/views/device/index.vue b/src/views/devices/index.vue similarity index 100% rename from src/views/device/index.vue rename to src/views/devices/index.vue diff --git a/src/views/orchardScreen/components/OrchardBriefInfo.vue b/src/views/orchardScreen/components/OrchardBriefInfo.vue index 1283202..8b0300a 100644 --- a/src/views/orchardScreen/components/OrchardBriefInfo.vue +++ b/src/views/orchardScreen/components/OrchardBriefInfo.vue @@ -2,36 +2,11 @@ * @Author: chris * @Date: 2025-08-25 15:42:45 * @LastEditors: chris - * @LastEditTime: 2025-09-02 16:28:57 + * @LastEditTime: 2025-10-15 16:00:17 -->