fix: BUG修改

This commit is contained in:
kun 2023-08-28 18:58:20 +08:00
parent dca0e454d4
commit 3202b28d73
6 changed files with 24 additions and 4 deletions

View File

@ -119,6 +119,7 @@ interface ProTableProps extends Partial<Omit<TableProps<any>, "data">> {
columns: ColumnProps[]; //
requestApi: (params: any) => Promise<any>; // api ==>
dataCallback?: (data: any) => any; // ==>
tableRowClassName: (data: any, dataIndex: number) => any; // ==>
title?: string; // ==>
pagination?: boolean; // ==> true
initParam?: any; // ==> {}

View File

@ -188,6 +188,7 @@
@include flex;
flex-direction: column;
align-items: center;
cursor: pointer;
> div {
position: relative;
img {

View File

@ -391,7 +391,7 @@ function parse(val) {
// div
const onSearch = async (params: any) => {
console.log(params);
active.value === 0 ? (searchSn.value = params.projectSn) : (searchSn.value = params.engineeringSn);
alarmActive.value === 0 ? (searchSn.value = params.projectSn) : (searchSn.value = params.engineeringSn);
getEquipList();
if (active.value === 0) {
getAlarmList();
@ -402,7 +402,7 @@ const onSearch = async (params: any) => {
// leftMenu
const onSearchInput = async (params: string) => {
leftMenuSearchForm.value.name = params;
if (active.value === 0) {
if (alarmActive.value === 0) {
getProPage();
} else {
getEngPage();
@ -411,7 +411,7 @@ const onSearchInput = async (params: string) => {
// leftMenu
const onCurChange = async (params: number) => {
alarmPages.value.pageSize = params;
if (active.value === 0) {
if (alarmActive.value === 0) {
getProPage();
} else {
getEngPage();

View File

@ -33,3 +33,13 @@
}
}
}
.el-table .warning-row,
.el-table .warning-row .el-table-fixed-column--right,
.el-table .warning-row .el-table-fixed-column--left {
background-color: var(--el-color-warning-light-9);
}
.el-table .success-row,
.el-table .success-row .el-table-fixed-column--right,
.el-table .success-row .el-table-fixed-column--left {
background-color: var(--el-color-success-light-9);
}

View File

@ -6,6 +6,7 @@
:columns="columns"
:requestApi="getTableList"
:dataCallback="dataCallback"
:row-class-name="tableRowClassName"
:tool-button="false"
:pagination="true"
background
@ -339,6 +340,7 @@ import {
} from "@/api/modules/project";
import { GlobalStore } from "@/stores";
import { Delete } from "@element-plus/icons-vue";
import { User } from "@/api/interface";
const baseUrl = import.meta.env.VITE_API_URL;
const typeList = ref([
{ label: "尖头塔", value: 1 },
@ -671,6 +673,13 @@ const handleDeleteItem = async (params: jxj_User.ResUserList) => {
await useHandleData(towerCraneEquipDel, { id: params.id }, `删除【${params.devName}`);
proTable.value.getTableList();
};
//
const tableRowClassName = ({ rowIndex }: { row: User.ResUserList; rowIndex: number }) => {
console.log(rowIndex);
if (rowIndex === 0) return "warning-row";
if (rowIndex === 6) return "success-row";
return "";
};
// dataCallback list && total && pageNum && pageSize
// hooks/useTable.ts
const dataCallback = (data: any) => {

View File

@ -129,7 +129,6 @@
.monitor-state {
@include flex;
flex-direction: column;
align-items: center;
cursor: pointer;
> div {
position: relative;