feat: 告警通知结构初始化、大屏默认设置暗色模式

dev-deviceSetting
donghao 1 year ago
parent daf7c98e5a
commit d39cadd8f3

@ -133,6 +133,14 @@ export default defineComponent({
visibleColumn: {
type: Boolean,
default: undefined
},
/**
*
*/
isFixedPagination: {
type: Boolean,
default: true
}
// handleDel: {
@ -383,7 +391,14 @@ export default defineComponent({
};
return (
<div class="x-table-pagination pagination_wrap">
<div
class={[
"x-table-pagination pagination_wrap",
props.isFixedPagination
? "fixed_pagination"
: "noneFixed_pagination"
]}
>
<ElPagination {...paginationProps} />
</div>
);

@ -2,12 +2,14 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-23 11:38:23
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-26 10:36:35
* @LastEditTime: 2024-02-26 17:27:17
* @FilePath: \General-AI-Platform-Web-Client\src\components\DsBox\index.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import dsBox1 from "./src/dsBox1";
import dsBox2 from "./src/dsBox2";
import dsTag1 from "./src/dsTag1";
export const DsBox1 = dsBox1;
export const DsBox2 = dsBox2;
export const DsTag1 = dsTag1;

@ -27,14 +27,6 @@ export default defineComponent({
},
setup(props, { slots }) {
// const count = ref<number>(1);
// const treeData = reactive({
// list: testDeviceTreeData
// });
/**
*
*/
return () => {
let options = {
width: "430px",

@ -0,0 +1,3 @@
.dsBox2_wrap {
//
}

@ -0,0 +1,75 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-26 17:24:07
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-26 17:42:29
* @FilePath: \General-AI-Platform-Web-Client\src\components\DsBox\src\dsBox2.tsx
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
/**
* @
*
* 1
* w1 1856px
* h1 763px
*
*
*
*/
import { defineComponent } from "vue";
import "./dsBox2.scss";
export default defineComponent({
name: "DsBox2",
props: {
type: {
type: String,
default: "default"
},
title: {
type: String,
default: ""
}
},
setup(props, { slots }) {
return () => {
let options = {
width: "1856px",
height: "763px"
};
switch (props.type) {
case "w1h1":
options = {
width: "430px",
height: "288px"
};
break;
default:
options = {
width: "100%",
height: "100%"
};
break;
}
return (
<div class="dsBox2_wrap w-full h-full">
<dv-border-box-10
style={{ width: options.width, height: options.height }}
>
<div class="w-full h-full">
<div
class="w-full"
style={{ height: `calc(${options.height} - 50px)` }}
>
{/* 主体内容 */}
{slots.default()}
</div>
</div>
</dv-border-box-10>
</div>
);
};
}
});

@ -8,14 +8,14 @@ import { useNav } from "@/layout/hooks/useNav";
import { useTranslationLang } from "../hooks/useTranslationLang";
// import globalization from "@/assets/svg/globalization.svg?component";
import LogoutCircleRLine from "@iconify-icons/ri/logout-circle-r-line";
// import Setting from "@iconify-icons/ri/settings-3-line";
import Setting from "@iconify-icons/ri/settings-3-line";
// import Check from "@iconify-icons/ep/check";
const {
layout,
// device,
logout,
// onPanel,
onPanel,
// pureApp,
username,
userAvatar,
@ -99,13 +99,13 @@ const {
</el-dropdown-menu>
</template>
</el-dropdown>
<!-- <span
<span
class="set-icon navbar-bg-hover"
:title="t('buttons.hssystemSet')"
@click="onPanel"
>
<IconifyIconOffline :icon="Setting" />
</span> -->
</span>
</div>
</div>
</template>

@ -106,7 +106,7 @@ onMounted(() => {
});
onBeforeMount(() => {
useDataThemeChange().dataThemeChange();
useDataThemeChange().setThemeByType("dark"); //
});
</script>

@ -94,6 +94,11 @@ export function useDataThemeChange() {
}
}
/**设置日间、夜间主题 */
function setThemeByType(themeType: string) {
document.documentElement.classList.add(themeType);
}
return {
body,
dataTheme,
@ -101,6 +106,7 @@ export function useDataThemeChange() {
themeColors,
dataThemeChange,
setEpThemeColor,
setLayoutThemeColor
setLayoutThemeColor,
setThemeByType
};
}

@ -0,0 +1,17 @@
//
// 1
.ds_title_1 {
font-family: "DouyinSansBold";
font-weight: bold;
font-size: 28px;
line-height: 33px;
text-align: left;
font-style: normal;
text-transform: none;
background: linear-gradient(to bottom, #ffffff 15%, #3397f4 99%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
$--el-text-color-regular: red;

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-22 14:04:38
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-22 17:48:10
* @LastEditTime: 2024-02-27 10:04:19
* @FilePath: \General-AI-Platform-Web-Client\src\pages\dataScreen\main.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -31,6 +31,7 @@ import "element-plus/dist/index.css";
// 导入字体图标
import "@/assets/iconfont/iconfont.js";
import "@/assets/iconfont/iconfont.css";
import "./app.scss";
const app = createApp(App);

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-23 11:00:08
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-26 14:18:27
* @LastEditTime: 2024-02-26 17:23:22
* @FilePath: \General-AI-Platform-Web-Client\src\pages\dataScreen\router\modules\device.ts
* @Description: ,`customMade`, koroFileHeader : https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@ -16,6 +16,6 @@ export default {
rank: 5,
roles: ["admin", "common"]
},
component: () => import("@/pages/dataScreen/views/device/deviceList.vue"),
component: () => import("@/pages/dataScreen/views/alarm/alarmInfoIndex.vue"),
name: "alarmInfo"
} as RouteConfigsTable;

@ -0,0 +1,6 @@
.alarmInfoIndex_wrap {
padding: 32px;
.alarm_main_info {
height: 763px;
}
}

@ -0,0 +1,310 @@
<!--
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-02-23 09:55:26
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-02-27 09:58:59
* @FilePath: \General-AI-Platform-Web-Client\src\pages\dataScreen\views\alarm\alarmInfoIndex.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script setup lang="ts">
import { DsBox2 } from "@/components/DsBox";
import { getAlarmList } from "@/api/list";
import { onMounted, ref, reactive, h } from "vue";
import { BaseTable } from "@/components/CustomTable";
import { getConfig } from "@/config";
import setting from "@/layout/components/setting/index.vue";
defineOptions({
name: "alarmInfoIndex"
});
const { EpThemeColor } = getConfig();
// TODO ~
const alarmLevelStatusEnum: Record<string, any>[] = [
{
color: "rgba(232, 13, 13, 1)",
value: "1",
label: "紧急",
isDelete: false,
icon: "ArrowUpOutlined",
id: "1"
},
{
color: "rgba(255, 136, 0, 1)",
value: "2",
label: "较高",
isDelete: false,
id: "2"
},
{
color: "rgba(68, 139, 245, 1)",
value: "3",
label: "一般",
isDelete: false,
id: "3"
},
{
color: "rgba(179, 214, 0, 1)",
value: "4",
label: "低",
isDelete: true,
id: "4"
},
{
color: "rgba(81, 177, 6, 1)",
value: "5",
label: "较低",
isDelete: true,
id: "5"
},
{
color: "rgba(43, 183, 136, 1)",
value: "6",
label: "非常低",
isDelete: true,
id: "6"
}
];
function handleDelete(row) {
console.log(row, "handleDelete_row");
}
const columns = [
{
type: "selection"
},
{
label: "告警名称",
property: "name"
},
{
label: "告警代码",
property: "code"
},
{
label: "告警等级",
property: "level",
formatter: val => {
const currentLevelObj = alarmLevelStatusEnum[Number(val?.level) - 1];
return h(
"div",
{
style: {
fontSize: "14px",
color: currentLevelObj.color
}
},
[
h("i", {
class: `iconfont pr-[8px] ${
currentLevelObj.value === "1"
? "icon-xiangshangjiantouquan"
: "icon-xiala"
}`
}),
h(
"span",
{
fontSize: "14px"
},
currentLevelObj.label
)
]
);
}
},
{
label: "设备组",
property: "deviceGroup",
formatter: val => {
return h(
"div",
{
style: {
fontSize: "14px",
color: EpThemeColor
}
},
[
h("i", {
class: `iconfont icon-zishebeizu pr-[8px]`
}),
h(
"span",
{
fontSize: "14px",
class: "pf-1"
},
val.deviceGroup
)
]
);
}
},
{
label: "告警日期",
property: "createTime"
},
// TODO
{
type: "action",
label: "操作"
}
];
const svg = `
<path class="path" d="
M 30 15
L 28 17
M 25.61 25.61
A 15 15, 0, 0, 1, 15 30
A 15 15, 0, 1, 1, 27.99 7.5
L 15 15
" style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
`;
const pagination = ref({ currentPage: 1, pageSize: 10, total: 0 });
const listData = ref([]);
// const searchValue = ref("");
const formData = reactive({
name: "",
level: ""
});
const dataLoading = ref(true);
const getList = async () => {
const { currentPage, pageSize } = pagination.value;
const { data } = await getAlarmList({ page: currentPage, pageSize });
listData.value = data.list;
console.log(data.list);
pagination.value = {
...pagination.value,
total: data.total
};
dataLoading.value = false;
// try {
// } catch (e) {
// console.log(e);
// } finally {
// setTimeout(() => {
// dataLoading.value = false;
// }, 500);
// }
};
function handleTableChange(record) {
console.log("handleTableChange_record", record);
pagination.value = {
...pagination.value,
currentPage: record.page,
pageSize: record.pageSize
};
getList();
}
/**操作栏事件 */
function handleDel(row) {
console.log(row, "handleDel");
}
onMounted(() => {
getList();
});
</script>
<template>
<div class="alarmInfoIndex_wrap">
<!-- 系统设置 -->
<p class="ds_title_1 pb-[16px]">设备告警通知</p>
<div class="alarm_main_info">
<DsBox2>
<template #default>
<!-- <div class="w-full h-full">表格</div> -->
<div class="main alarm_wrap pt-[18px] px-[24px]">
<el-form
:inline="true"
:model="formData"
class="demo-form-inline ds_form"
>
<el-form-item label="告警名称">
<el-select
v-model="formData.name"
placeholder="告警名称"
clearable
>
<el-option label="名称1" value="1" />
<el-option label="名称2" value="2" />
</el-select>
</el-form-item>
<el-form-item label="告警等级">
<el-select
v-model="formData.level"
placeholder="告警等级"
clearable
>
<el-option
v-for="(v, k) in alarmLevelStatusEnum"
:key="k"
:label="v.label"
:value="v.value"
/>
</el-select>
</el-form-item>
</el-form>
<div
class="alarm_table"
v-loading="dataLoading"
:element-loading-svg="svg"
element-loading-svg-view-box="-10, -10, 50, 50"
>
<template v-if="pagination.total > 0">
<BaseTable
:total="pagination.total"
:pageSize="pagination.pageSize"
:dataSource="listData"
:isFixedPagination="false"
:columns="columns"
@actions="handleDelete"
:page="pagination.currentPage"
@change="handleTableChange"
>
<template v-slot:actionBar="{ row }">
<ul class="table_action_box">
<li class="flex items-center" @click="handleDel(row)">
<el-button text>
<i
class="iconfont icon-shanchu pr-[8px]"
:style="{ fontSize: '14px', color: '#E80D0D' }"
/>
<span
:style="{
fontSize: '14px',
color: '#E80D0D'
}"
>
删除
</span>
</el-button>
</li>
</ul>
</template>
</BaseTable>
</template>
</div>
</div>
</template>
</DsBox2>
</div>
</div>
</template>
<style lang="scss">
@import "./alarmInfoIndex.scss";
</style>

@ -1,11 +0,0 @@
<script setup lang="ts">
defineOptions({
name: ""
});
</script>
<template>
<div>告警通知</div>
</template>
<style lang="scss" scoped></style>

@ -139,3 +139,10 @@ html.dark {
}
}
}
/* 深色系样式 */
//
.ds_form {
}
//

@ -172,6 +172,8 @@
/* 分页栏 */
.pagination_wrap {
}
.fixed_pagination {
width: calc(100% - 136px);
background-color: white;
z-index: 9;
@ -183,6 +185,12 @@
bottom: 0;
padding: 20px 40px 40px;
}
.noneFixed_pagination {
display: flex;
align-items: center;
justify-content: flex-end;
padding: 20px 0;
}
/* table */

Loading…
Cancel
Save