feat: 开始日志模块
parent
18dce5efe8
commit
9949a3ff0b
@ -0,0 +1,11 @@
|
|||||||
|
/*
|
||||||
|
* @Author: donghao donghao@supervision.ltd
|
||||||
|
* @Date: 2025-07-08 14:28:02
|
||||||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||||||
|
* @LastEditTime: 2025-07-08 14:28:24
|
||||||
|
* @FilePath: \Robot-Al-Platform-Web\src\renderer\src\components\Table\index.ts
|
||||||
|
* @Description: 表格控件集
|
||||||
|
*/
|
||||||
|
import baseTable from './src/baseTable'
|
||||||
|
|
||||||
|
export const DSTable = baseTable
|
@ -0,0 +1,104 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: donghao donghao@supervision.ltd
|
||||||
|
* @Date: 2024-01-18 14:27:25
|
||||||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||||||
|
* @LastEditTime: 2024-02-21 15:08:35
|
||||||
|
* @FilePath: \General-AI-Platform-Web-Client\src\components\CustomTable\src\column.vue
|
||||||
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-dialog v-model="dialogVisible" :width="600" title="自定义列">
|
||||||
|
<!-- footer -->
|
||||||
|
<template #footer>
|
||||||
|
<el-row type="flex" justify="center">
|
||||||
|
<el-button @click="handleCancel"> 取消 </el-button>
|
||||||
|
<el-button type="primary" @click="handleConfirm"> 确定 </el-button>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- body -->
|
||||||
|
<div class="x-custom-column">
|
||||||
|
<template v-for="item in items" :key="item.prop || item.type">
|
||||||
|
<el-checkbox
|
||||||
|
v-if="!item.type"
|
||||||
|
v-model="item.show"
|
||||||
|
:label="item.label"
|
||||||
|
size="large"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref, watch } from "vue";
|
||||||
|
|
||||||
|
interface ModalProps {
|
||||||
|
visible: boolean;
|
||||||
|
columns: XTableColumn[];
|
||||||
|
}
|
||||||
|
|
||||||
|
type XCustomColumn = XTableColumn & {
|
||||||
|
show: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<ModalProps>(), {
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: "update:visible", value: boolean): void;
|
||||||
|
(e: "visibleChange", value: boolean): void;
|
||||||
|
(e: "change", value: XTableColumn[]): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const dialogVisible = computed({
|
||||||
|
get: () => props.visible,
|
||||||
|
set: val => {
|
||||||
|
emit("update:visible", val);
|
||||||
|
emit("visibleChange", val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const items = ref<XCustomColumn[]>([]);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
value => {
|
||||||
|
if (value) {
|
||||||
|
items.value = props.columns.map(i => ({
|
||||||
|
...i,
|
||||||
|
show: !i.hidden
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
function handleConfirm() {
|
||||||
|
const data = items.value.map(i => {
|
||||||
|
const { show, ...rest } = i;
|
||||||
|
return {
|
||||||
|
...rest,
|
||||||
|
hidden: !show
|
||||||
|
};
|
||||||
|
});
|
||||||
|
emit("change", data);
|
||||||
|
dialogVisible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleCancel() {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.x-custom-column {
|
||||||
|
min-height: 100px;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
.el-checkbox {
|
||||||
|
width: 18%;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,153 @@
|
|||||||
|
.baseTable_wrap {
|
||||||
|
/* 去掉表格整体边框 */
|
||||||
|
.el-table {
|
||||||
|
border: none !important;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 去掉表头下边框 */
|
||||||
|
.el-table__header-wrapper thead th {
|
||||||
|
border-bottom: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
/* 去掉单元格边框 */
|
||||||
|
.el-table td,
|
||||||
|
.el-table th.is-leaf {
|
||||||
|
border-bottom: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
/* 去掉纵向分割线 */
|
||||||
|
.el-table--border::after,
|
||||||
|
.el-table--group::after,
|
||||||
|
.el-table::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.el-table--border,
|
||||||
|
.el-table--group {
|
||||||
|
border-right: none !important;
|
||||||
|
border-bottom: none !important;
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
.el-table td,
|
||||||
|
.el-table th {
|
||||||
|
border-right: none !important;
|
||||||
|
border: none !important;
|
||||||
|
border-collapse: collapse !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-scrollbar__view {
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table--large .el-table__cell {
|
||||||
|
padding: 8.5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.baseTable_box {
|
||||||
|
cursor: pointer;
|
||||||
|
.el-table__body {
|
||||||
|
background: transparent;
|
||||||
|
border-collapse: collapse !important;
|
||||||
|
border: none !important;
|
||||||
|
tr {
|
||||||
|
color: #fff;
|
||||||
|
background: transparent;
|
||||||
|
border-top: 1px solid transparent;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
|
||||||
|
&:hover td {
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
color: #37dbff;
|
||||||
|
background: linear-gradient(
|
||||||
|
90deg,
|
||||||
|
rgba(30, 54, 88, 0) 0%,
|
||||||
|
#0c4fad 53%,
|
||||||
|
rgba(65, 117, 190, 0) 100%
|
||||||
|
);
|
||||||
|
border-top: 1px solid rgba(69, 174, 250, 0.3);
|
||||||
|
border-bottom: 1px solid rgba(69, 174, 250, 0.3);
|
||||||
|
}
|
||||||
|
&.selected-row {
|
||||||
|
color: #37dbff;
|
||||||
|
background: linear-gradient(
|
||||||
|
90deg,
|
||||||
|
rgba(30, 54, 88, 0) 0%,
|
||||||
|
#0c4fad 53%,
|
||||||
|
rgba(65, 117, 190, 0) 100%
|
||||||
|
);
|
||||||
|
border-top: 1px solid rgba(69, 174, 250, 0.3);
|
||||||
|
border-bottom: 1px solid rgba(69, 174, 250, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__header > thead {
|
||||||
|
color: #9fb5d7;
|
||||||
|
background-color: #104284 !important;
|
||||||
|
tr {
|
||||||
|
background-color: #104284 !important;
|
||||||
|
}
|
||||||
|
th {
|
||||||
|
background-color: #104284 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.fixed_pagination {
|
||||||
|
padding: 12px 20px 0;
|
||||||
|
}
|
||||||
|
/* full_table */
|
||||||
|
&.full_table {
|
||||||
|
.el-table--large .el-table__cell {
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
.baseTable_box {
|
||||||
|
cursor: default;
|
||||||
|
.el-table__body {
|
||||||
|
border: none !important;
|
||||||
|
background: linear-gradient(90deg, #082050 0%, #02102a 100%);
|
||||||
|
tr {
|
||||||
|
color: #fff;
|
||||||
|
background: linear-gradient(90deg, #082050 0%, #02102a 100%);
|
||||||
|
&:nth-child(odd) {
|
||||||
|
background: linear-gradient(90deg, #082050 0%, #02102a 100%);
|
||||||
|
}
|
||||||
|
&:nth-child(even) {
|
||||||
|
background: linear-gradient(90deg, #102d65 0%, #081736 100%);
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
&:hover td {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-table__header > thead {
|
||||||
|
color: #9fb5d7;
|
||||||
|
background-color: #104284 !important;
|
||||||
|
tr {
|
||||||
|
background-color: #104284 !important;
|
||||||
|
}
|
||||||
|
th {
|
||||||
|
background-color: #104284 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.fixed_pagination {
|
||||||
|
padding: 28px 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagination_box {
|
||||||
|
margin-top: 50px;
|
||||||
|
width: 100%;
|
||||||
|
// position: fixed;
|
||||||
|
// bottom: 100px;
|
||||||
|
// right: 40px;
|
||||||
|
background-color: white;
|
||||||
|
z-index: 9;
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
import type ElTable from "element-plus/lib/components/table";
|
||||||
|
import type { ElTableColumn } from "element-plus/lib/components/table";
|
||||||
|
|
||||||
|
export {};
|
||||||
|
|
||||||
|
type ElTableType = InstanceType<typeof ElTable>;
|
||||||
|
type ElTableProps = ElTableType["$props"];
|
||||||
|
type ElTableColumnProps = InstanceType<typeof ElTableColumn>["$props"];
|
||||||
|
type ElTableSort = Pick<
|
||||||
|
Required<ElTableProps>["defaultSort"],
|
||||||
|
"prop" | "order"
|
||||||
|
>;
|
||||||
|
|
||||||
|
type ElTableAction = {
|
||||||
|
type: "delete" | "update" | string; // 操作类型
|
||||||
|
confirmType?: "popup" | "modal"; // 确认组件
|
||||||
|
};
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
type XTableSort = ElTableSort;
|
||||||
|
|
||||||
|
interface XTableColumn extends ElTableColumnProps {
|
||||||
|
children?: XTableColumn[];
|
||||||
|
hidden?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface XTableData {
|
||||||
|
[key: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface XTableState {
|
||||||
|
tid: number;
|
||||||
|
sortBy?: XTableSort["prop"];
|
||||||
|
sortOrder?: XTableSort["order"];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface XTableChangeData extends Partial<XTableSort> {
|
||||||
|
type: "size" | "number" | "sort";
|
||||||
|
pageNum: number;
|
||||||
|
pageSize: number;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
.logList-dialog{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,106 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: donghao donghao@supervision.ltd
|
||||||
|
* @Date: 2025-07-08 14:15:11
|
||||||
|
* @LastEditors: donghao donghao@supervision.ltd
|
||||||
|
* @LastEditTime: 2025-07-08 14:59:03
|
||||||
|
* @FilePath: \Robot-Al-Platform-Web\src\renderer\src\views\Design\LogManagement\logList.vue
|
||||||
|
* @Description: 日志服务
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<DSDialog
|
||||||
|
v-model="show"
|
||||||
|
width="800"
|
||||||
|
@close="handleClose"
|
||||||
|
class="logList-dialog ds-dialog"
|
||||||
|
title="日志"
|
||||||
|
>
|
||||||
|
<div class="logList-container">
|
||||||
|
<ul class="logList-sidebar">
|
||||||
|
<li
|
||||||
|
class="flex items-center justify-center sidebar-item"
|
||||||
|
:class="{ active: activeTab.includes(v.value) }"
|
||||||
|
@click="addSearchType(v)"
|
||||||
|
v-for="(v, k) in logSearchTypes"
|
||||||
|
:key="k"
|
||||||
|
>
|
||||||
|
<DSButton
|
||||||
|
:type="activeTab.includes(v.value) ? 'primary' : ''"
|
||||||
|
size="default"
|
||||||
|
class="mr-[24px] mb-[24px]"
|
||||||
|
>{{ v.label }}</DSButton
|
||||||
|
>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<!-- //TODO 列表 -->
|
||||||
|
</div>
|
||||||
|
</DSDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DSButton } from '@/components/Button'
|
||||||
|
import { DSDialog } from '@/components/Dialog'
|
||||||
|
|
||||||
|
interface logSearchTypeItem {
|
||||||
|
label: string
|
||||||
|
value: string // 可以是路由地址或者其他唯一标识
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
/** 弹窗显隐 */
|
||||||
|
value: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Emits {
|
||||||
|
(e: 'update:value', val: boolean): void
|
||||||
|
}
|
||||||
|
|
||||||
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
|
value: false
|
||||||
|
})
|
||||||
|
const emit = defineEmits<Emits>()
|
||||||
|
|
||||||
|
// 处理对话框关闭事件
|
||||||
|
const handleClose = () => {
|
||||||
|
// emits('close');
|
||||||
|
}
|
||||||
|
|
||||||
|
const show = computed({
|
||||||
|
get() {
|
||||||
|
return props.value
|
||||||
|
},
|
||||||
|
set(val: boolean) {
|
||||||
|
emit('update:value', val)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const logSearchTypes: logSearchTypeItem[] = [
|
||||||
|
{
|
||||||
|
label: '全部',
|
||||||
|
value: '0'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '告警',
|
||||||
|
value: '1'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '错误',
|
||||||
|
value: '2'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '信息',
|
||||||
|
value: '3'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
const activeTab = ref<string[]>(['0'])
|
||||||
|
|
||||||
|
const addSearchType = (v: logSearchTypeItem) => {
|
||||||
|
if (activeTab.value.includes(v.value)) {
|
||||||
|
activeTab.value = activeTab.value.filter((item) => item !== v.value)
|
||||||
|
} else {
|
||||||
|
activeTab.value.push(v.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
@import url('./logList.scss');
|
||||||
|
</style>
|
@ -1,49 +0,0 @@
|
|||||||
<el-dialog
|
|
||||||
align-center
|
|
||||||
v-model="showPermissionDialog"
|
|
||||||
width="520"
|
|
||||||
@close="showPermissionDialog = false"
|
|
||||||
class="settings-dialog ds-dialog"
|
|
||||||
>
|
|
||||||
<template #header="{ close, titleId, titleClass }">
|
|
||||||
<div class="flex items-center justify-between h-full dialog-header pl-[24px]">
|
|
||||||
<p class="overflow-hidden whitespace-nowrap text-ellipsis">权限分配</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div class="p-[24px]">
|
|
||||||
<el-form
|
|
||||||
style="max-width: 472px"
|
|
||||||
:model="permissionFromData"
|
|
||||||
label-width="auto"
|
|
||||||
label-position="top"
|
|
||||||
size="default"
|
|
||||||
>
|
|
||||||
<el-form-item label="选择开放给技术员的工具权限" prop="pass">
|
|
||||||
<el-checkbox label="所有权限"></el-checkbox>
|
|
||||||
<!-- <el-checkbox
|
|
||||||
v-model="checkAll"
|
|
||||||
:indeterminate="isIndeterminate"
|
|
||||||
@change="handleCheckAllChange"
|
|
||||||
>
|
|
||||||
</el-checkbox> -->
|
|
||||||
<!-- @change="handleCheckedPermissionChange" -->
|
|
||||||
<!-- // TODO 和UI图调整一致 -->
|
|
||||||
<el-checkbox-group v-model="permissionFromData.permission">
|
|
||||||
<el-checkbox
|
|
||||||
v-for="v in ['权限1', '权限2', '权限3', '权限4', '权限5']"
|
|
||||||
:key="v"
|
|
||||||
:label="v"
|
|
||||||
:value="v"
|
|
||||||
>
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer mr-[24px] pb-[24px] pt-[16px]">
|
|
||||||
<DSButton type="info" @click="resetPermission()" class="mr-[8px]">取消</DSButton>
|
|
||||||
<DSButton type="primary" @click="submitPermission()" class="">确定</DSButton>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
Loading…
Reference in New Issue