diff --git a/package.json b/package.json index dba621cd..f20bcbfb 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "element-plus": "^2.8.7", "exceljs": "^4.4.0", "file-saver": "^2.0.5", + "grid-layout-plus": "^1.1.0", "html2canvas": "^1.4.1", "jquery": "^3.7.1", "js-pinyin": "^0.2.5", diff --git a/src/api/system-boot/csstatisticalset.ts b/src/api/system-boot/csstatisticalset.ts index c3d8b367..5385f0a5 100644 --- a/src/api/system-boot/csstatisticalset.ts +++ b/src/api/system-boot/csstatisticalset.ts @@ -1,6 +1,6 @@ import createAxios from '@/utils/request' // 查询指标 -export const queryStatistical = (id:string) => { +export const queryStatistical = (id: string) => { let form = new FormData() form.append('id', id) return createAxios({ @@ -14,10 +14,49 @@ export const queryStatistical = (id:string) => { } // 绑定指标 -export const addStatistical = (params:any) => { +export const addStatistical = (params: any) => { return createAxios({ url: '/system-boot/csstatisticalset/addStatistical', method: 'post', data: params }) } +// 新增驾驶舱页面 +export const addDashboard = (data: any) => { + return createAxios({ + url: '/system-boot/dashboard/addDashboard', + method: 'post', + data: data + }) +} +// 修改驾驶舱页面 +export const updateDashboard = (data: any) => { + return createAxios({ + url: '/system-boot/dashboard/updateDashboard', + method: 'post', + data: data + }) +} +// 删除驾驶舱页面 +export const deleteDashboard = (params: any) => { + return createAxios({ + url: '/system-boot/dashboard/deleteDashboard', + method: 'post', + params + }) +} +// 激活的驾驶舱页面 +export const activatePage = (params: any) => { + return createAxios({ + url: '/system-boot/dashboard/activatePage', + method: 'post', + params + }) +} +// 查询激活的驾驶舱页面 +export const queryActivatePage = () => { + return createAxios({ + url: '/system-boot/dashboard/queryActivatePage', + method: 'post' + }) +} diff --git a/src/api/user-boot/dept.ts b/src/api/user-boot/dept.ts index 3839c30f..2afd75cd 100644 --- a/src/api/user-boot/dept.ts +++ b/src/api/user-boot/dept.ts @@ -80,3 +80,39 @@ export function getDeptListByIds(data:any) { }) } +// 查询组件 +export function getFatherComponent(params:any) { + return request({ + url: '/user-boot/component/getFatherComponent', + method: 'GET', + params + }) +} + +// 删除组件 +export function deleteSubassembly(params:any) { + return request({ + url: '/user-boot/component/delete', + method: 'DELETE', + params + }) +} + +// 新增组件 +export function componentAdd(data:any) { + return request({ + url: '/user-boot/component/add', + method: 'post', + data + }) +} + +// 修改组件 +export function componentEdit(data:any) { + return request({ + url: '/user-boot/component/update', + method: 'put', + data + }) +} + diff --git a/src/api/user-boot/user.ts b/src/api/user-boot/user.ts index 480dc2db..e4d325b5 100644 --- a/src/api/user-boot/user.ts +++ b/src/api/user-boot/user.ts @@ -206,3 +206,10 @@ export const getSysConfig = () => { method: 'get' }) } +// 驾驶舱组件配置 +export const componentTree = () => { + return request({ + url: '/user-boot/component/componentTree', + method: 'GET' + }) +} diff --git a/src/assets/imgs/1x1.png b/src/assets/imgs/1x1.png new file mode 100644 index 00000000..b9a83e95 Binary files /dev/null and b/src/assets/imgs/1x1.png differ diff --git a/src/assets/imgs/2x2.png b/src/assets/imgs/2x2.png new file mode 100644 index 00000000..49aedb71 Binary files /dev/null and b/src/assets/imgs/2x2.png differ diff --git a/src/assets/imgs/2x3.png b/src/assets/imgs/2x3.png new file mode 100644 index 00000000..1d153e89 Binary files /dev/null and b/src/assets/imgs/2x3.png differ diff --git a/src/assets/imgs/3x3.png b/src/assets/imgs/3x3.png new file mode 100644 index 00000000..37e4e126 Binary files /dev/null and b/src/assets/imgs/3x3.png differ diff --git a/src/assets/imgs/amplify.png b/src/assets/imgs/amplify.png new file mode 100644 index 00000000..b9fb4497 Binary files /dev/null and b/src/assets/imgs/amplify.png differ diff --git a/src/assets/imgs/reduce.png b/src/assets/imgs/reduce.png new file mode 100644 index 00000000..de9c23b0 Binary files /dev/null and b/src/assets/imgs/reduce.png differ diff --git a/src/components/echarts/MyEchart.vue b/src/components/echarts/MyEchart.vue index 9e9efda4..4ea16338 100644 --- a/src/components/echarts/MyEchart.vue +++ b/src/components/echarts/MyEchart.vue @@ -112,7 +112,7 @@ const initChart = () => { ...(props.options?.legend || null) }, grid: { - top: '70px', + top: '50px', left: '30px', right: '70px', bottom: props.options?.options?.dataZoom === null ? '10px' : '40px', diff --git a/src/styles/vxeTable.scss b/src/styles/vxeTable.scss index 7d6cc4ff..56ce9d97 100644 --- a/src/styles/vxeTable.scss +++ b/src/styles/vxeTable.scss @@ -20,10 +20,10 @@ // } .vxe-header--row { - // background: var(--vxe-table-header-background-color); - // color: var(--vxe-table-header-font-color); - background: var(--el-color-primary); - color: #fff; + background: var(--vxe-table-header-background-color); + color: var(--vxe-table-header-font-color); + // background: var(--el-color-primary); + // color: #fff; font-size: 14px; } diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index 134a986e..cfd958b1 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -5,51 +5,51 @@ import type { TableColumnCtx } from 'element-plus' * 日期快捷选项适用于 el-date-picker */ export const defaultShortcuts = [ - { - text: '今天', - value: () => { - return new Date() + { + text: '今天', + value: () => { + return new Date() + } + }, + { + text: '昨天', + value: () => { + const date = new Date() + date.setTime(date.getTime() - 3600 * 1000 * 24) + return [date, date] + } + }, + { + text: '最近七天', + value: () => { + const date = new Date() + date.setTime(date.getTime() - 3600 * 1000 * 24 * 7) + return [date, new Date()] + } + }, + { + text: '最近 30 天', + value: () => { + const date = new Date() + date.setTime(date.getTime() - 3600 * 1000 * 24 * 30) + return [date, new Date()] + } + }, + { + text: '本月', + value: () => { + const date = new Date() + date.setDate(1) // 设置为当前月的第一天 + return [date, new Date()] + } + }, + { + text: '今年', + value: () => { + const date = new Date() + return [new Date(`${date.getFullYear()}-01-01`), date] + } } - }, - { - text: '昨天', - value: () => { - const date = new Date() - date.setTime(date.getTime() - 3600 * 1000 * 24) - return [date, date] - } - }, - { - text: '最近七天', - value: () => { - const date = new Date() - date.setTime(date.getTime() - 3600 * 1000 * 24 * 7) - return [date, new Date()] - } - }, - { - text: '最近 30 天', - value: () => { - const date = new Date() - date.setTime(date.getTime() - 3600 * 1000 * 24 * 30) - return [date, new Date()] - } - }, - { - text: '本月', - value: () => { - const date = new Date() - date.setDate(1) // 设置为当前月的第一天 - return [date, new Date()] - } - }, - { - text: '今年', - value: () => { - const date = new Date() - return [new Date(`${date.getFullYear()}-01-01`), date] - } - } ] /** @@ -64,19 +64,19 @@ export const defaultShortcuts = [ * @returns 返回拼接后的时间字符串 */ export function formatDate(date: Date, format?: string): string { - // 日期不存在,则返回空 - if (!date) { - return '' - } - // 日期存在,则进行格式化 - return date ? dayjs(date).format(format ?? 'YYYY-MM-DD HH:mm:ss') : '' + // 日期不存在,则返回空 + if (!date) { + return '' + } + // 日期存在,则进行格式化 + return date ? dayjs(date).format(format ?? 'YYYY-MM-DD HH:mm:ss') : '' } /** * 获取当前的日期+时间 */ export function getNowDateTime() { - return dayjs() + return dayjs() } /** @@ -85,18 +85,18 @@ export function getNowDateTime() { * @returns 返回第几周数字值 */ export function getWeek(dateTime: Date): number { - const temptTime = new Date(dateTime.getTime()) - // 周几 - const weekday = temptTime.getDay() || 7 - // 周1+5天=周六 - temptTime.setDate(temptTime.getDate() - weekday + 1 + 5) - let firstDay = new Date(temptTime.getFullYear(), 0, 1) - const dayOfWeek = firstDay.getDay() - let spendDay = 1 - if (dayOfWeek != 0) spendDay = 7 - dayOfWeek + 1 - firstDay = new Date(temptTime.getFullYear(), 0, 1 + spendDay) - const d = Math.ceil((temptTime.valueOf() - firstDay.valueOf()) / 86400000) - return Math.ceil(d / 7) + const temptTime = new Date(dateTime.getTime()) + // 周几 + const weekday = temptTime.getDay() || 7 + // 周1+5天=周六 + temptTime.setDate(temptTime.getDate() - weekday + 1 + 5) + let firstDay = new Date(temptTime.getFullYear(), 0, 1) + const dayOfWeek = firstDay.getDay() + let spendDay = 1 + if (dayOfWeek != 0) spendDay = 7 - dayOfWeek + 1 + firstDay = new Date(temptTime.getFullYear(), 0, 1 + spendDay) + const d = Math.ceil((temptTime.valueOf() - firstDay.valueOf()) / 86400000) + return Math.ceil(d / 7) } /** @@ -111,38 +111,38 @@ export function getWeek(dateTime: Date): number { * @returns 返回拼接后的时间字符串 */ export function formatPast(param: string | Date, format = 'YYYY-mm-dd HH:MM:SS'): string { - // 传入格式处理、存储转换值 - let t: any, s: number - // 获取js 时间戳 - let time: number = new Date().getTime() - // 是否是对象 - typeof param === 'string' || 'object' ? (t = new Date(param).getTime()) : (t = param) - // 当前时间戳 - 传入时间戳 - time = Number.parseInt(`${time - t}`) - if (time < 10000) { - // 10秒内 - return '刚刚' - } else if (time < 60000 && time >= 10000) { - // 超过10秒少于1分钟内 - s = Math.floor(time / 1000) - return `${s}秒前` - } else if (time < 3600000 && time >= 60000) { - // 超过1分钟少于1小时 - s = Math.floor(time / 60000) - return `${s}分钟前` - } else if (time < 86400000 && time >= 3600000) { - // 超过1小时少于24小时 - s = Math.floor(time / 3600000) - return `${s}小时前` - } else if (time < 259200000 && time >= 86400000) { - // 超过1天少于3天内 - s = Math.floor(time / 86400000) - return `${s}天前` - } else { - // 超过3天 - const date = typeof param === 'string' || 'object' ? new Date(param) : param - return formatDate(date, format) - } + // 传入格式处理、存储转换值 + let t: any, s: number + // 获取js 时间戳 + let time: number = new Date().getTime() + // 是否是对象 + typeof param === 'string' || 'object' ? (t = new Date(param).getTime()) : (t = param) + // 当前时间戳 - 传入时间戳 + time = Number.parseInt(`${time - t}`) + if (time < 10000) { + // 10秒内 + return '刚刚' + } else if (time < 60000 && time >= 10000) { + // 超过10秒少于1分钟内 + s = Math.floor(time / 1000) + return `${s}秒前` + } else if (time < 3600000 && time >= 60000) { + // 超过1分钟少于1小时 + s = Math.floor(time / 60000) + return `${s}分钟前` + } else if (time < 86400000 && time >= 3600000) { + // 超过1小时少于24小时 + s = Math.floor(time / 3600000) + return `${s}小时前` + } else if (time < 259200000 && time >= 86400000) { + // 超过1天少于3天内 + s = Math.floor(time / 86400000) + return `${s}天前` + } else { + // 超过3天 + const date = typeof param === 'string' || 'object' ? new Date(param) : param + return formatDate(date, format) + } } /** @@ -152,15 +152,15 @@ export function formatPast(param: string | Date, format = 'YYYY-mm-dd HH:MM:SS') * @returns 返回拼接后的时间字符串 */ export function formatAxis(param: Date): string { - const hour: number = new Date(param).getHours() - if (hour < 6) return '凌晨好' - else if (hour < 9) return '早上好' - else if (hour < 12) return '上午好' - else if (hour < 14) return '中午好' - else if (hour < 17) return '下午好' - else if (hour < 19) return '傍晚好' - else if (hour < 22) return '晚上好' - else return '夜里好' + const hour: number = new Date(param).getHours() + if (hour < 6) return '凌晨好' + else if (hour < 9) return '早上好' + else if (hour < 12) return '上午好' + else if (hour < 14) return '中午好' + else if (hour < 17) return '下午好' + else if (hour < 19) return '傍晚好' + else if (hour < 22) return '晚上好' + else return '夜里好' } /** @@ -170,24 +170,24 @@ export function formatAxis(param: Date): string { * @returns {string} 字符串 */ export function formatPast2(ms: number): string { - const day = Math.floor(ms / (24 * 60 * 60 * 1000)) - const hour = Math.floor(ms / (60 * 60 * 1000) - day * 24) - const minute = Math.floor(ms / (60 * 1000) - day * 24 * 60 - hour * 60) - const second = Math.floor(ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60) - if (day > 0) { - return day + ' 天' + hour + ' 小时 ' + minute + ' 分钟' - } - if (hour > 0) { - return hour + ' 小时 ' + minute + ' 分钟' - } - if (minute > 0) { - return minute + ' 分钟' - } - if (second > 0) { - return second + ' 秒' - } else { - return 0 + ' 秒' - } + const day = Math.floor(ms / (24 * 60 * 60 * 1000)) + const hour = Math.floor(ms / (60 * 60 * 1000) - day * 24) + const minute = Math.floor(ms / (60 * 1000) - day * 24 * 60 - hour * 60) + const second = Math.floor(ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60) + if (day > 0) { + return day + ' 天' + hour + ' 小时 ' + minute + ' 分钟' + } + if (hour > 0) { + return hour + ' 小时 ' + minute + ' 分钟' + } + if (minute > 0) { + return minute + ' 分钟' + } + if (second > 0) { + return second + ' 秒' + } else { + return 0 + ' 秒' + } } /** @@ -198,7 +198,7 @@ export function formatPast2(ms: number): string { * @param cellValue 字段值 */ export function dateFormatter(_row: any, _column: TableColumnCtx, cellValue: any): string { - return cellValue ? formatDate(cellValue) : '' + return cellValue ? formatDate(cellValue) : '' } /** @@ -209,7 +209,7 @@ export function dateFormatter(_row: any, _column: TableColumnCtx, cellValue * @param cellValue 字段值 */ export function dateFormatter2(_row: any, _column: TableColumnCtx, cellValue: any): string { - return cellValue ? formatDate(cellValue, 'YYYY-MM-DD') : '' + return cellValue ? formatDate(cellValue, 'YYYY-MM-DD') : '' } /** @@ -218,7 +218,7 @@ export function dateFormatter2(_row: any, _column: TableColumnCtx, cellValu * @returns 带时间00:00:00的日期 */ export function beginOfDay(param: Date): Date { - return new Date(param.getFullYear(), param.getMonth(), param.getDate(), 0, 0, 0) + return new Date(param.getFullYear(), param.getMonth(), param.getDate(), 0, 0, 0) } /** @@ -227,7 +227,7 @@ export function beginOfDay(param: Date): Date { * @returns 带时间23:59:59的日期 */ export function endOfDay(param: Date): Date { - return new Date(param.getFullYear(), param.getMonth(), param.getDate(), 23, 59, 59) + return new Date(param.getFullYear(), param.getMonth(), param.getDate(), 23, 59, 59) } /** @@ -236,10 +236,10 @@ export function endOfDay(param: Date): Date { * @param param2 日期2 */ export function betweenDay(param1: Date, param2: Date): number { - param1 = convertDate(param1) - param2 = convertDate(param2) - // 计算差值 - return Math.floor((param2.getTime() - param1.getTime()) / (24 * 3600 * 1000)) + param1 = convertDate(param1) + param2 = convertDate(param2) + // 计算差值 + return Math.floor((param2.getTime() - param1.getTime()) / (24 * 3600 * 1000)) } /** @@ -248,8 +248,8 @@ export function betweenDay(param1: Date, param2: Date): number { * @param param2 添加的时间 */ export function addTime(param1: Date, param2: number): Date { - param1 = convertDate(param1) - return new Date(param1.getTime() + param2) + param1 = convertDate(param1) + return new Date(param1.getTime() + param2) } /** @@ -257,10 +257,10 @@ export function addTime(param1: Date, param2: number): Date { * @param param 日期 */ export function convertDate(param: Date | string): Date { - if (typeof param === 'string') { - return new Date(param) - } - return param + if (typeof param === 'string') { + return new Date(param) + } + return param } /** @@ -269,11 +269,11 @@ export function convertDate(param: Date | string): Date { * @param b 日期 B */ export function isSameDay(a: dayjs.ConfigType, b: dayjs.ConfigType): boolean { - if (!a || !b) return false + if (!a || !b) return false - const aa = dayjs(a) - const bb = dayjs(b) - return aa.year() == bb.year() && aa.month() == bb.month() && aa.day() == bb.day() + const aa = dayjs(a) + const bb = dayjs(b) + return aa.year() == bb.year() && aa.month() == bb.month() && aa.day() == bb.day() } /** @@ -281,39 +281,36 @@ export function isSameDay(a: dayjs.ConfigType, b: dayjs.ConfigType): boolean { * @param date 日期 * @param days 天数 */ -export function getDayRange( - date: dayjs.ConfigType, - days: number -): [dayjs.ConfigType, dayjs.ConfigType] { - const day = dayjs(date).add(days, 'd') - return getDateRange(day, day) +export function getDayRange(date: dayjs.ConfigType, days: number): [dayjs.ConfigType, dayjs.ConfigType] { + const day = dayjs(date).add(days, 'd') + return getDateRange(day, day) } /** * 获取最近7天的开始时间、截止时间 */ export function getLast7Days(): [dayjs.ConfigType, dayjs.ConfigType] { - const lastWeekDay = dayjs().subtract(7, 'd') - const yesterday = dayjs().subtract(1, 'd') - return getDateRange(lastWeekDay, yesterday) + const lastWeekDay = dayjs().subtract(7, 'd') + const yesterday = dayjs().subtract(1, 'd') + return getDateRange(lastWeekDay, yesterday) } /** * 获取最近30天的开始时间、截止时间 */ export function getLast30Days(): [dayjs.ConfigType, dayjs.ConfigType] { - const lastMonthDay = dayjs().subtract(30, 'd') - const yesterday = dayjs().subtract(1, 'd') - return getDateRange(lastMonthDay, yesterday) + const lastMonthDay = dayjs().subtract(30, 'd') + const yesterday = dayjs().subtract(1, 'd') + return getDateRange(lastMonthDay, yesterday) } /** * 获取最近1年的开始时间、截止时间 */ export function getLast1Year(): [dayjs.ConfigType, dayjs.ConfigType] { - const lastYearDay = dayjs().subtract(1, 'y') - const yesterday = dayjs().subtract(1, 'd') - return getDateRange(lastYearDay, yesterday) + const lastYearDay = dayjs().subtract(1, 'y') + const yesterday = dayjs().subtract(1, 'd') + return getDateRange(lastYearDay, yesterday) } /** @@ -321,12 +318,17 @@ export function getLast1Year(): [dayjs.ConfigType, dayjs.ConfigType] { * @param beginDate 开始日期 * @param endDate 截止日期 */ -export function getDateRange( - beginDate: dayjs.ConfigType, - endDate: dayjs.ConfigType -): [string, string] { - return [ - dayjs(beginDate).startOf('d').format('YYYY-MM-DD HH:mm:ss'), - dayjs(endDate).endOf('d').format('YYYY-MM-DD HH:mm:ss') - ] +export function getDateRange(beginDate: dayjs.ConfigType, endDate: dayjs.ConfigType): [string, string] { + return [ + dayjs(beginDate).startOf('d').format('YYYY-MM-DD HH:mm:ss'), + dayjs(endDate).endOf('d').format('YYYY-MM-DD HH:mm:ss') + ] +} +/** + * 获取当月时间 + * @param beginDate 开始日期 + * @param endDate 截止日期 + */ +export function getTimeOfTheMonth(): [string, string] { + return [formatDate(new Date(), 'YYYY-MM') + '-01', formatDate(new Date(), 'YYYY-MM-DD')] } diff --git a/src/views/cockpit/TerminalLog.vue b/src/views/cockpit/TerminalLog.vue new file mode 100644 index 00000000..0ea4e991 --- /dev/null +++ b/src/views/cockpit/TerminalLog.vue @@ -0,0 +1,105 @@ + + + diff --git a/src/views/cockpit/qualifiedRate.vue b/src/views/cockpit/qualifiedRate.vue new file mode 100644 index 00000000..9ce14cc6 --- /dev/null +++ b/src/views/cockpit/qualifiedRate.vue @@ -0,0 +1,263 @@ + + + diff --git a/src/views/cockpit/testEchart.vue b/src/views/cockpit/testEchart.vue new file mode 100644 index 00000000..fe9532df --- /dev/null +++ b/src/views/cockpit/testEchart.vue @@ -0,0 +1,98 @@ + + + diff --git a/src/views/pqs/cockpit/homePage/index.vue b/src/views/pqs/cockpit/homePage/index.vue new file mode 100644 index 00000000..910bba19 --- /dev/null +++ b/src/views/pqs/cockpit/homePage/index.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/src/views/pqs/cockpit/setUp/components/popup.vue b/src/views/pqs/cockpit/setUp/components/popup.vue new file mode 100644 index 00000000..d8a9d5f1 --- /dev/null +++ b/src/views/pqs/cockpit/setUp/components/popup.vue @@ -0,0 +1,374 @@ + + + diff --git a/src/views/pqs/cockpit/setUp/index.vue b/src/views/pqs/cockpit/setUp/index.vue new file mode 100644 index 00000000..64d6060a --- /dev/null +++ b/src/views/pqs/cockpit/setUp/index.vue @@ -0,0 +1,287 @@ + + + diff --git a/src/views/setting/dictionary/component/add.vue b/src/views/setting/dictionary/component/add.vue new file mode 100644 index 00000000..40682714 --- /dev/null +++ b/src/views/setting/dictionary/component/add.vue @@ -0,0 +1,113 @@ + + diff --git a/src/views/setting/dictionary/component/index.vue b/src/views/setting/dictionary/component/index.vue new file mode 100644 index 00000000..939432d2 --- /dev/null +++ b/src/views/setting/dictionary/component/index.vue @@ -0,0 +1,129 @@ + +