优化 监控中心 前台页面

This commit is contained in:
fks-yangshouda
2024-08-22 15:23:02 +08:00
parent 05bb62752b
commit 7b1f25689e
12 changed files with 122 additions and 80 deletions

View File

@@ -149,7 +149,7 @@ export const formSchema = [
component: 'NsInput',
componentProps: {
placeholder: '请输入',
maxLength: 32,
maxLength: 20,
},
rules: [
{
@@ -410,25 +410,26 @@ export const tableConfigCal = (
}
},
},
isCarbon
? {
label: '关联因子值',
name: 'SetFactor',
type: 'primary',
dynamicDisabled: (data: any) => {
return data.list.length === 0;
},
handle: ({ list }) => {
// 过滤出 id 大于 0 的项
const filteredList = list.filter(({ id }) => id > 0);
{
label: '关联因子值',
name: 'SetFactor',
type: 'primary',
dynamicDisabled: (data: any) => {
return data.list.length === 0;
},
ifShow: (data: any) => {
return isCarbon;
},
handle: ({ list }) => {
// 过滤出 id 大于 0 的项
const filteredList = list.filter(({ id }) => id > 0);
// 提取出 id 值
const ids = filteredList.map(({ id }) => id);
// 提取出 id 值
const ids = filteredList.map(({ id }) => id);
setFactorRef.value.toggle(ids);
},
}
: {},
setFactorRef.value.toggle(ids);
},
},
{
label: '批量删除',
name: 'GroupPointDelete',
@@ -518,10 +519,29 @@ export const tableConfigCal = (
actions: [
{
label: '关联因子',
// label: (record) => {
// // 根据record的某个字段值判断显示'关联因子'或'修改因子'
// return record.emissionFactor ? '修改因子' : '关联因子';
// },
name: 'SetFactor',
dynamicDisabled: (record) => {
ifShow: (record) => {
// 这里根据record的某个字段值判断是否禁用删除按钮
return record.id < 0;
return isCarbon && record.id >= 0 && !record.emissionFactor;
},
handle: (row) => {
setFactorRef.value.toggle([row.id]);
},
},
{
label: '修改关联',
// label: (record) => {
// // 根据record的某个字段值判断显示'关联因子'或'修改因子'
// return record.emissionFactor ? '修改因子' : '关联因子';
// },
name: 'SetFactor',
ifShow: (record) => {
// 这里根据record的某个字段值判断是否禁用删除按钮
return isCarbon && record.id >= 0 && record.emissionFactor;
},
handle: (row) => {
setFactorRef.value.toggle([row.id]);
@@ -530,9 +550,9 @@ export const tableConfigCal = (
{
label: '删除',
name: 'GroupPointDelete',
dynamicDisabled: (record) => {
ifShow: (record) => {
// 这里根据record的某个字段值判断是否禁用删除按钮
return record.id < 0;
return record.id >= 0;
},
dynamicParams: isCarbon
? {
@@ -797,7 +817,7 @@ export const editCarbonEquipmentConfig = (orgId) => {
],
params: {},
},
// pagination: { pageSizeOptions: false },
pagination: true,
rowKey: 'deviceInfoCode',
});
};

View File

@@ -9,7 +9,9 @@
:cancel="() => (visible = false)"
placement="right">
<div class="drawerContainer">
<ns-tree-api v-bind="config" @select="treeSelect" />
<div style="padding: 10px; border: 1px solid #d9d9d9; border-radius: 4px">
<ns-tree-api v-bind="config" @select="treeSelect" />
</div>
<a-transfer
v-model:target-keys="targetKeys"
:data-source="dataSource"

View File

@@ -120,4 +120,7 @@
right: 50px; /* Adjust based on your modal's positioning */
// z-index: 1050; /* Ensure it's above the modal's backdrop */
}
::v-deep .ant-table-pagination.ant-pagination {
margin: 26px 0 !important; /* 根据需要调整 padding 大小 */
}
</style>

View File

@@ -22,7 +22,9 @@
? 'fenzujiedian'
: 'jisuanjiedian'
" />
<span style="padding-left: 8px">{{ data.pointName }}</span>
<span style="padding-left: 8px" :title="data.pointName">
{{ truncatedName(data.pointName) }}
</span>
</div>
<a-dropdown>
<ns-icon name="actionMore" size="14" class="actionMore" />
@@ -52,15 +54,7 @@
v-show="!defaultType && isCarbon"
class="table"
v-bind="configCarbon"
ref="tableCalRef">
<!-- <template #bodyCell="{ column, record }">
<template v-if="column.title === '操作'">
<a-button type="link" @click="setStandard(record)" v-if="record.id != selectedKey[0]"
>设为目标值</a-button
>
</template>
</template> -->
</ns-view-list-table>
ref="tableCalRef" />
</div>
</template>
<script lang="ts" setup>
@@ -208,6 +202,12 @@
const res = actions.filter(({ key, name }) => list.includes(key) && checkAllPermission(name));
return res;
};
const truncatedName = (name) => {
if (name.length > 8) {
return name.substring(0, 8) + '...';
}
return name;
};
const actionList = [
{ title: '新增子节点', name: 'GroupAdd', key: 'addNodeSon', func: (data) => addNodeSon(data) },
{ title: '编辑', name: 'GroupEdit', key: 'editNode', func: (data) => editNode(data) },