Compare commits

...

16 Commits

Author SHA1 Message Date
zhaohy
d004a06ec1 fix:修改样式 2024-07-08 10:53:27 +08:00
fks-yangshouda
76248c0f70 Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp 2024-07-08 10:42:46 +08:00
fks-yangshouda
6e294e13eb 注释环境监测路由 2024-07-08 10:42:35 +08:00
zhaohy
7a9bea2f8e Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp 2024-07-08 10:40:28 +08:00
zhaohy
77052ae284 fix:还原工作组件 2024-07-08 10:40:26 +08:00
chenpingsen
33eb153885 add:照明系统页面修改/修改中 2024-07-08 10:34:43 +08:00
28723
a3a5b63ea5 Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp 2024-07-08 10:32:55 +08:00
chenpingsen
7a20eb8603 Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp 2024-07-08 10:19:53 +08:00
28723
dc29be2718 Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp 2024-07-08 10:13:13 +08:00
28723
f28b224c91 taskId:067 remark:"commit" 2024-07-08 10:13:07 +08:00
fks-yangshouda
bfd6282a99 Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp 2024-07-08 10:09:33 +08:00
28723
64cfd47d50 Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp 2024-07-08 10:05:22 +08:00
28723
796d2fcf63 碳排因子库页面代码提交 2024-07-08 10:04:04 +08:00
fks-yangshouda
287dc9262b * add: 添加监控中心-设备监测页面 2024-07-08 10:03:22 +08:00
chenpingsen
9ad9446cae add:照明系统样式 2024-07-08 10:02:05 +08:00
28723
1d4b76492d 碳排因子库页面 2024-07-08 09:48:44 +08:00
29 changed files with 5161 additions and 2221 deletions

View File

@@ -0,0 +1,12 @@
export enum carbonEmissionFactorLibrary {
getTableList = '/carbon/emission/factor/queryCarbonFactorPage',
addNewData = '/carbon/emission/factor/creatOrUpdate',
editUser = '/carbon-smart/api/user/edit',
frozen = '/carbon-smart/api/user/frozen',
resetPwd = '/carbon-smart/api/user/resetPwd',
del = '/carbon-smart/api/user/del',
batchDel = '/carbon-smart/api/user/batchDel',
getCarbonFactorTree = '/carbon/emission/type/getCarbonFactorTree',
queryDeptTree = '/carbon-smart/api/user/queryDeptTree',
queryUserPerList = '/carbon-smart/api/user/queryUserPerList',
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1720144479404" class="icon" viewBox="0 0 1142 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2572" xmlns:xlink="http://www.w3.org/1999/xlink" width="17.84375" height="16"><path d="M1102.769231 39.384615v945.23077H39.384615V39.384615h1063.384616m0-39.384615H39.384615a39.384615 39.384615 0 0 0-39.384615 39.384615v945.23077a39.384615 39.384615 0 0 0 39.384615 39.384615h1063.384616a39.384615 39.384615 0 0 0 39.384615-39.384615V39.384615a39.384615 39.384615 0 0 0-39.384615-39.384615z" fill="#4D4D4D" p-id="2573"></path><path d="M39.384615 393.846154h1063.384616v39.384615H39.384615zM39.384615 590.769231h1063.384616v39.384615H39.384615zM39.384615 787.692308h1063.384616v39.384615H39.384615zM39.384615 196.923077h1063.384616v39.384615H39.384615z" fill="#B3B3B3" p-id="2574"></path><path d="M315.076923 196.923077v787.692308H275.692308V196.923077zM590.769231 196.923077v787.692308h-39.384616V196.923077zM866.461538 196.923077v787.692308h-39.384615V196.923077z" fill="#B3B3B3" p-id="2575"></path><path d="M39.384615 39.384615h1063.384616v157.538462H39.384615z" fill="#05AFC8" p-id="2576"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1720145764410" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4680" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M495.611479 159.364238C285.562631 159.364238 115.284768 329.642102 115.284768 539.690949S285.562631 920.01766 495.611479 920.01766 875.93819 749.739797 875.93819 539.690949H518.216336c-12.484662 0-22.604857-10.120194-22.604857-22.604856V159.364238z" fill="#839BFB" p-id="4681"></path><path d="M562.860927 495.046358h368.459161c0-215.978102-175.085916-391.064018-391.064017-391.064018v368.459161c0 12.484662 10.120194 22.604857 22.604856 22.604857z" fill="#839BFB" fill-opacity=".6" p-id="4682"></path></svg>

After

Width:  |  Height:  |  Size: 838 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1720061440927" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11363" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M659.925333 128a74.666667 74.666667 0 0 1 71.338667 52.618667L754.56 256H821.333333c64.8 0 117.333333 52.533333 117.333334 117.333333v426.666667c0 64.8-52.533333 117.333333-117.333334 117.333333H202.666667c-64.8 0-117.333333-52.533333-117.333334-117.333333V373.333333c0-64.8 52.533333-117.333333 117.333334-117.333333h66.773333l23.296-75.381333A74.666667 74.666667 0 0 1 364.074667 128h295.850666zM512 405.333333c-88.362667 0-160 71.637333-160 160 0 88.362667 71.637333 160 160 160 88.362667 0 160-71.637333 160-160 0-88.362667-71.637333-160-160-160z m0 256a96 96 0 1 0 0-192 96 96 0 0 0 0 192z" fill="#000000" p-id="11364"></path></svg>

After

Width:  |  Height:  |  Size: 969 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1720061108318" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10061" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M512 12L94.71 138v314.92C94.71 657.7 263.86 880.16 512 1012c248.14-131.84 417.29-354.3 417.29-559.08V138z m209.91 510H562v159.91H462V522H302.09V422H462V262.09h100V422h159.91z" fill="#2c2c2c" p-id="10062"></path></svg>

After

Width:  |  Height:  |  Size: 549 B

View File

@@ -0,0 +1,50 @@
const Base = () => import('/nerv-lib/saas/view/system/layout/content.vue');
const equipment = {
path: '/carbonEmissionManage',
name: 'CarbonEmissionManage',
meta: { title: '碳排管理', icon: 'shebeiguanli', index: 1 },
redirect: { name: 'CarbonEmissionStatistics' },
children: [
{
path: 'carbonEmissionStatistics',
name: 'CarbonEmissionStatistics',
meta: { title: '碳排统计', hideChildren: true, icon: 'shebeiguanli' },
component: Base,
redirect: { name: 'CarbonEmissionStatisticsIndex' },
children: [
{
path: 'index',
name: 'CarbonEmissionStatisticsIndex',
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
component: () => import('/@/view/carbonEmissionManage/carbonEmissionStatistics/index.vue'),
meta: {
title: '碳排统计',
keepAlive: true,
// backApi: [],
},
},
],
},
{
path: 'carbonEmissionFactorLibrary',
name: 'CarbonEmissionFactorLibrary',
meta: { title: '碳排因子库', hideChildren: true, icon: 'shebeiguanli' },
component: Base,
redirect: { name: 'CarbonEmissionFactorLibraryIndex' },
children: [
{
path: 'index',
name: 'CarbonEmissionFactorLibraryIndex',
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
component: () => import('/@/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue'),
meta: {
title: '碳排因子库',
keepAlive: true,
// backApi: [],
},
},
],
},
],
};
export default equipment;

View File

@@ -0,0 +1,67 @@
const Base = () => import('/nerv-lib/saas/view/system/layout/content.vue');
const equipment = {
path: '/monitor',
name: 'Monitor',
meta: { title: '监控中心', icon: 'jiankongzhongxin', index: 1 },
redirect: { name: 'EnvironmentMonitor' },
children: [
// {
// path: 'environmentMonitor',
// name: 'EnvironmentMonitor',
// meta: { title: '环境监测', hideChildren: true, icon: 'huanjingjiance' },
// component: Base,
// redirect: { name: 'EnvironmentMonitorIndex' },
// children: [
// {
// path: 'index',
// name: 'EnvironmentMonitorIndex',
// component: () => import('/@/view/monitor/environmentMonitor/index.vue'),
// meta: {
// title: '环境监测',
// keepAlive: true,
// // backApi: [],
// },
// },
// ],
// },
{
path: 'deviceMonitor',
name: 'DeviceMonitor',
meta: { title: '设备监测', hideChildren: true, icon: 'huanjingjiance' },
component: Base,
redirect: { name: 'DeviceMonitorIndex' },
children: [
{
path: 'index',
name: 'DeviceMonitorIndex',
component: () => import('/@/view/monitor/deviceMonitor/index.vue'),
meta: {
title: '设备监测',
keepAlive: true,
// backApi: [],
},
},
],
},
// {
// path: 'group',
// name: 'Group',
// meta: { title: '分组管理', hideChildren: true, icon: 'shebeiguanli' },
// component: Base,
// redirect: { name: 'GroupIndex' },
// children: [
// {
// path: 'index',
// name: 'GroupIndex',
// component: () => import('/@/view/monitor/group/index.vue'),
// meta: {
// title: '分组管理',
// keepAlive: true,
// // backApi: [],
// },
// },
// ],
// },
],
};
export default equipment;

View File

@@ -135,7 +135,7 @@
name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => {
console.log(data, 'xxxxxxx');
editConfigureDeviceAlarms.value.toggle(data);
},
},
{

View File

@@ -2,11 +2,11 @@
<ns-drawer
v-model:visible="visible"
width="520"
:title="infoObject?.id ? '编辑' : '新增'"
:title="infoObject?.id ? '编辑告警规则' : '新增告警规则'"
:ok="btnClick"
:cancel="handleClose"
placement="right">
<div style="padding: 18px">
<div style="padding: 18px; width: 100%; overflow: hidden">
<a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item ref="name" label="站点" name="name">
<a-tree-select
@@ -72,12 +72,6 @@
:filter-option="filterOption"
@change="handleQzChange" />
</a-form-item>
<a-form-item label="规则类型" name="resource">
<a-radio-group v-model:value="infoObject.resource">
<a-radio value="1">(and)</a-radio>
<a-radio value="2">(or)</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="异常描述" name="desc">
<a-textarea
v-model:value="infoObject.desc"
@@ -86,17 +80,44 @@
show-count
:maxlength="30" />
</a-form-item>
<a-form-item label="规则类型" name="resource">
<a-radio-group v-model:value="infoObject.resource">
<a-radio value="1"> (and) </a-radio>
<a-radio value="2"> (or) </a-radio>
</a-radio-group>
</a-form-item>
<template v-for="index in infoObject.alarmList?.length" :key="index">
<a-form-item :label="`逻辑${index}`" name="alarm">
<a-input style="width: 60px" v-model:value="infoObject.alarmList[index - 1].alarm" />
</a-form-item>
<a-form-item :label="`数值${index}`" name="number">
<div
style="
width: 100%;
display: flex;
margin-left: 42px;
padding: 12px;
border-color: #ff4d4f !important;
">
<span style="line-height: 32px">{{ `逻辑${index}:` }}</span>
<a-select
v-model:value="infoObject.alarmList[index - 1].alarm"
style="width: 70px; margin-left: 12px"
:options="ljOptions"
@change="handleQzChange" />
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
<a-input
style="width: 60px"
style="width: 65px; margin-left: 6px"
type="number"
v-model:value="infoObject.alarmList[index - 1].number" />
</a-form-item>
<div
style="width: 70px; align-items: center; cursor: pointer"
@click="deleteAlarmList(index - 1)">
<img
style="width: 14px; margin: 0 12px"
src="https://files.axshare.com/gsc/4T0UQR/5a/e6/81/5ae6813d499c422383c7a15dd956523f/images/设备规则/u72.svg?pageId=cbce6e61-bc6a-4283-802d-993fce6151c0" />
</div>
</div>
</template>
<div style="width: 100%; margin-top: 12px; display: flex; justify-content: flex-end">
<a-button type="primary" @click="addAlarmList"> 新增</a-button>
</div>
</a-form>
</div>
</ns-drawer>
@@ -120,6 +141,8 @@
delivery: null,
alarmList: [{ alarm: null, number: null }],
});
//删除的逻辑列表
const delAlarmList = ref([]);
const formRef = ref();
//站点数
const zdTreeData = ref<TreeSelectProps['treeData']>([
@@ -193,6 +216,14 @@
{ value: '实时值', label: '实时值', code: '1' },
{ value: '平均值', label: '平均值', code: '2' },
]);
//逻辑
const ljOptions = ref<SelectProps['options']>([
{ value: '1', label: '≥' },
{ value: '2', label: '>' },
{ value: '3', label: '≤' },
{ value: '4', label: '<' },
{ value: '5', label: '=' },
]);
//设备点位方法
const filterOption = (input: string, option: any) => {
console.log('搜索', option.value);
@@ -264,6 +295,7 @@
//数据是否验证通过
formRef.value.validate().then(() => {
console.log('values', infoObject, toRaw(infoObject));
delAlarmList.value = [];
});
//调用接口
// http
@@ -293,8 +325,24 @@
alarmList: [{ alarm: null, number: null }],
};
visible.value = false;
delAlarmList.value = [];
NsMessage.success('操作成功');
};
// 新增逻辑列表
const addAlarmList = () => {
if (infoObject.value.alarmList) {
infoObject.value.alarmList.push({ alarm: null, number: null });
} else {
infoObject.value.alarmList = [{ alarm: null, number: null }];
}
};
// 删除 逻辑列表、
const deleteAlarmList = (index: number) => {
if (infoObject.value.alarmList[index]?.id) {
delAlarmList.value.push(infoObject.value.alarmList[index]);
}
infoObject.value.alarmList.splice(index, 1);
};
defineExpose({
toggle,
handleClose,
@@ -334,6 +382,6 @@
/deep/ .ant-form-item-label {
z-index: 20;
text-align: right;
width: 20%;
width: 23%;
}
</style>

View File

@@ -2,7 +2,7 @@
<ns-drawer
v-model:visible="visible"
width="520"
:title="infoObject?.id ? '编辑' : '新增'"
:title="infoObject?.id ? '修改告警功能' : '新增告警'"
:ok="btnClick"
:cancel="handleClose"
placement="right">

View File

@@ -2,7 +2,7 @@
<div class="box">
<a-tabs default-active-key="1" @change="callback">
<a-tab-pane key="1" tab="通知管理">
<ns-view-list-table v-bind="notificationConfig" ref="mainRef" @switch="changeUse" />
<ns-view-list-table v-bind="notificationConfig" ref="mainRef" />
</a-tab-pane>
<a-tab-pane key="2" tab="设备告警" force-render>
<ns-view-list-table v-show="equipmentAlarm" class="table" v-bind="equipmentAlarmConfig" />
@@ -54,11 +54,11 @@
equipmentAlarm.value = !equipmentAlarm.value;
configureDeviceAlarms.value.show = false;
};
const changeUse = () => {
console.log(mainRef.value);
mainRef.value?.nsTableRef.reload();
// console.log(newList.value.formFinish, '数据');
};
// const changeUse = () => {
// console.log(mainRef.value);
// mainRef.value?.nsTableRef.reload();
// // console.log(newList.value.formFinish, '数据');
// };
// 编辑或添加成功 刷新列表
const editObject = () => {
console.log('添加成功 刷新列表');
@@ -69,7 +69,6 @@
callback,
notificationConfig,
equipmentAlarmConfig,
changeUse,
editObject,
editEquipmentAlarm,
configureDeviceAlarms,
@@ -81,9 +80,6 @@
};
</script>
<style lang="less" scoped>
/deep/ .ant-tabs-nav {
width: 100%;
}
.box {
width: 100%;
height: 100%;

View File

@@ -16,7 +16,7 @@ const tableKeyMap = [
dataIndex: 'id',
},
{
title: '设备信',
title: '设备信',
dataIndex: 'deviceCode',
},
{

View File

@@ -0,0 +1,229 @@
import { ref } from 'vue';
import { http } from '/nerv-lib/util';
import { origanizemanage } from '/@/api/origanizemanage';
export const formConfig = (disabled) => {
return ref([
{
field: 'field111',
component: 'NsChildForm',
componentProps: {
schemas: [
{
label: '排放源',
field: 'accountNo',
component: 'NsInput',
componentProps: {
placeholder: '请输入排放源',
maxLength: 20,
disabled,
},
rules: [
{
required: true,
message: '请输入排放源',
},
],
},
{
field: 'userStatus',
label: '排放气体',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择排放气体',
options: [
{
label: '正常',
value: 0,
},
{
label: '冻结',
value: 1,
},
],
},
rules: [
{
required: true,
message: '请选择排放气体',
},
],
},
{
field: 'userStatus',
label: '排放环节',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择排放环节',
options: [
{
label: '正常',
value: 0,
},
{
label: '冻结',
value: 1,
},
],
},
},
{
label: '排放因子',
field: 'accountNo',
component: 'NsInput',
componentProps: {
placeholder: '请输入排放因子值',
maxLength: 20,
disabled,
},
rules: [
{
required: true,
message: '请输入排放因子值',
},
],
},
{
field: 'userStatus',
label: '碳排前缀',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择碳排前缀',
options: [
{
label: '正常',
value: 0,
},
{
label: '冻结',
value: 1,
},
],
},
rules: [
{
required: true,
message: '请选择碳排前缀',
},
],
},
{
label: '碳排后缀',
field: 'accountNo',
component: 'NsInput',
componentProps: {
placeholder: '请输入碳排后缀',
maxLength: 20,
disabled,
},
rules: [
{
required: true,
message: '请输入碳排后缀',
},
],
},
{
label: '已引用数',
field: 'accountNo',
component: 'NsInput',
componentProps: {
disabled: true,
maxLength: 20,
},
},
{
label: '参考文献',
field: 'accountNo',
component: 'NsTextarea',
componentProps: {
placeholder: '请输入参考文献',
maxLength: 20,
disabled,
},
},
],
},
},
]);
};
const options = ref([]);
const getUserPerList = (transform, params = {}) => {
return http.post(origanizemanage.queryUserPerList, { ...params }).then((res) => {
return res.data?.map((item) => {
item = { ...item, ...transform(item) };
return item;
});
});
};
export const formConfig2 = (casData: any) => {
return ref([
{
field: 'information',
component: 'NsCascader',
componentProps: {
placeholder: '请选择',
displayRender: ({ labels, selectedOptions }: any) => {
console.log(labels, selectedOptions);
casData.value = selectedOptions.map(({ label, value }) => {
return { label, value };
});
return labels.join('/');
},
loadData: (selectedOptions, options) => {
console.log(selectedOptions, options, 'selectedOptions, options');
const targetOption = selectedOptions[selectedOptions.length - 1];
let transForm, params;
// load options lazily
if (!selectedOptions.length) {
transForm = (data) => {
data['label'] = data.orgName;
data['value'] = data.orgId;
data['isLeaf'] = false;
data['level'] = 1;
return data;
};
getUserPerList(transForm).then((res) => {
options.value = [...res];
});
}
const id = targetOption?.value;
const level = targetOption?.level;
if (targetOption) {
targetOption.loading = true;
}
if (level === 1) {
transForm = (data) => {
data['label'] = data.deptName;
data['value'] = data.deptId;
data['isLeaf'] = false;
data['level'] = 2;
return data;
};
params = { orgId: id };
} else if (level === 2) {
transForm = (data) => {
data['label'] = data.roleName;
data['value'] = data.roleId;
data['level'] = 3;
return data;
};
params = { deptId: id };
}
if (targetOption) {
getUserPerList(transForm, { ...params }).then((res) => {
targetOption.loading = false;
targetOption.children = [...res];
});
}
},
},
},
]);
};

View File

@@ -0,0 +1,619 @@
<!-- @format -->
<template>
<div class="main">
<div class="left">
<div class="top">
<a-form style="width: 100%;margin: 0 auto;">
<div class="ns-form-title"><span>排放分类</span></div>
<div style="padding: 0 16px !important;width: 100%;">
<a-row>
<a-col :span="24" style="margin-bottom: 16px;">
<a-input-search
v-model:value="selectTreeDataValue"
placeholder="请输入关键词"
@search="onSearchTreeData"
/>
</a-col>
</a-row>
</div>
</a-form>
<a-tree
class="draggable-tree"
style="padding: 0 16px !important;"
draggable
show-line
checkable
block-node
:tree-data="gData"
@dragenter="onDragEnter"
@drop="onDrop"
:expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent"
@expand="onExpand"
>
<template #title="{ emissionName }">
<span v-if="emissionName && selectTreeDataValue && emissionName.indexOf(selectTreeDataValue) > -1">
{{ emissionName.substring(0, emissionName.indexOf(selectTreeDataValue)) }}
<span style="color: #f50">{{ selectTreeDataValue }}</span>
{{ emissionName.substring(emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length) }}
</span>
<span v-else>{{ emissionName }}</span>
</template>
</a-tree>
<a-popover placement="rightTop" trigger="focus">
<template #content>
<div style="display: flex;flex-direction: column;">
<a-button type="text">编辑</a-button>
<a-button type="text">新增子节点</a-button>
<a-button type="text">删除</a-button>
</div>
</template>
<MoreOutlined style="position: absolute;right: 0;top: 16%;font-size: 25px;cursor: pointer;" />
</a-popover>
<div class="addTreeNode">
<a-button type="primary" style="width:100%;" @click="addTreeNodeData">新增</a-button>
</div>
</div>
</div>
<div class="right">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000}"/>
</div>
<!-- 新增树节点 -->
<ns-modal :visible="treeNodeAdd" :title="operationTree" @ok="handleOk" @cancel="handleCancel">
<ns-input
v-model:value="latitude1"
class="input"
placeholder="请输入排放类型"
/>
</ns-modal>
<!-- 新增数据库数据 -->
<a-drawer
:width="500"
:visible="visible"
:body-style="{ paddingBottom: '80px' }"
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
<ns-form
ref="formRef"
:schemas="formSchema"
:model="formData"
class="form"
:wrapperCol="{ span: 20 }"
formLayout="vertical" />
<template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
<a-button type="primary" @click="onEdit">确定</a-button>
</template>
</a-drawer>
</div>
</template>
<script lang="ts" setup>
import { MoreOutlined } from '@ant-design/icons-vue';
import { computed, createVNode, defineComponent, reactive, ref, watchEffect,watch } from 'vue';
import { http } from '/nerv-lib/util/http';
import { NsMessage, NsModal } from '/nerv-lib/component';
import { formConfig, formConfig2 } from './config';
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
import type {
AntTreeNodeDragEnterEvent,
AntTreeNodeDropEvent,
TreeProps,
} from 'ant-design-vue/es/tree';
import { log } from 'node:console';
defineOptions({ name: 'OrderListIndex' });
const selectTreeDataValue = ref<string>('');
const mainRef = ref();
const data = reactive({});
let formData = ref({});
const formRef = ref();
const visible = ref(false);
const searchValue = ref<string>('');
const searchValue2 = ref<string>('');
const disabled = ref(false);
const treeNodeAdd = ref<boolean>(false);
const operationTree = ref<string>('新增');
const opMap: any = ref({
type: 'add',
fuc: () => {},
record: {},
});
watchEffect(() => {
disabled.value = opMap.value.type === 'edit';
});
const formSchema = formConfig(disabled);
const casData = ref([]);
const treeData = ref([]);
const userAuthList = ref([]);
const orgId = JSON.parse(sessionStorage.getItem('userInfo')).orgId;
const dynamicDisabled = computed(() => {
return formRef.value?.validateResult && userAuthList.value?.length;
});
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
// 树结构
const x = 3;
const y = 2;
const z = 1;
const genData: TreeProps['treeData'] = [];
const generateData = (_level: number, _preKey?: string, _tns?: TreeProps['treeData']) => {
const preKey = _preKey || '0';
const tns = _tns || genData;
const children = [];
for (let i = 0; i < x; i++) {
const key = `${preKey}-${i}`;
tns.push({ title: key, key });
if (i < y) {
children.push(key);
}
}
if (_level < 0) {
return tns;
}
const level = _level - 1;
children.forEach((key, index) => {
tns[index].children = [];
return generateData(level, key, tns[index].children);
});
};
generateData(z);
type TreeDataItem = TreeProps['treeData'][number];
const gData = ref<TreeProps['treeData']>(genData);
const onDragEnter = (info: AntTreeNodeDragEnterEvent) => {
console.log(info);
// expandedKeys 需要展开时
// expandedKeys.value = info.expandedKeys;
};
const onDrop = (info: AntTreeNodeDropEvent) => {
console.log(info);
const dropKey = info.node.key;
const dragKey = info.dragNode.key;
const dropPos = info.node.pos.split('-');
const dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]);
const loop = (data: TreeProps['treeData'], key: string | number, callback: any) => {
data.forEach((item, index) => {
if (item.key === key) {
return callback(item, index, data);
}
if (item.children) {
return loop(item.children, key, callback);
}
});
};
const data = [...gData.value];
// Find dragObject
let dragObj: TreeDataItem;
loop(data, dragKey, (item: TreeDataItem, index: number, arr: TreeProps['treeData']) => {
arr.splice(index, 1);
dragObj = item;
});
if (!info.dropToGap) {
// Drop on the content
loop(data, dropKey, (item: TreeDataItem) => {
item.children = item.children || [];
/// where to insert 示例添加到头部,可以是随意位置
item.children.unshift(dragObj);
});
} else if (
(info.node.children || []).length > 0 && // Has children
info.node.expanded && // Is expanded
dropPosition === 1 // On the bottom gap
) {
loop(data, dropKey, (item: TreeDataItem) => {
item.children = item.children || [];
// where to insert 示例添加到头部,可以是随意位置
item.children.unshift(dragObj);
});
} else {
let ar: TreeProps['treeData'] = [];
let i = 0;
loop(data, dropKey, (_item: TreeDataItem, index: number, arr: TreeProps['treeData']) => {
ar = arr;
i = index;
});
if (dropPosition === -1) {
ar.splice(i, 0, dragObj);
} else {
ar.splice(i + 1, 0, dragObj);
}
}
gData.value = data;
};
const dataList: TreeProps['treeData'] = [];
const generateList = (data: TreeProps['treeData']) => {
for (let i = 0; i < data.length; i++) {
const node = data[i];
const key = node.key;
dataList.push({ key, title: key });
if (node.children) {
generateList(node.children);
}
}
};
generateList(genData);
const getParentKey = (
key: string | number,
tree: TreeProps['treeData'],
): string | number | undefined => {
let parentKey;
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.children) {
if (node.children.some(item => item.key === key)) {
parentKey = node.key;
} else if (getParentKey(key, node.children)) {
parentKey = getParentKey(key, node.children);
}
}
}
return parentKey;
};
const expandedKeys = ref<(string | number)[]>([]);
const autoExpandParent = ref<boolean>(true);
const onExpand = (keys: string[]) => {
expandedKeys.value = keys;
autoExpandParent.value = false;
};
watch(selectTreeDataValue, value => {
const expanded = dataList
.map((item: TreeProps['treeData'][number]) => {
if (item.title.indexOf(value) > -1) {
return getParentKey(item.key, gData.value);
}
return null;
})
.filter((item, i, self) => item && self.indexOf(item) === i);
expandedKeys.value = expanded;
selectTreeDataValue.value = value;
autoExpandParent.value = true;
});
// 筛选树结构中的数据
const onSearchTreeData = (selectTreeDataValue: string) => {
console.log('use value', selectTreeDataValue);
console.log('or use this.value', value.value);
};
// 点击新增树节点
const addTreeNodeData = () => {
treeNodeAdd.value = true;
};
const handleOk = (e: MouseEvent) => {
console.log(e);
treeNodeAdd.value = false;
};
const handleCancel = () => {
treeNodeAdd.value = false;
};
// 企业树
const getOrgTree = (params?) => {
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, params).then((res) => {
gData.value = res
});
};
getOrgTree();
const onSearch = () => {
console.log(searchValue.value);
getOrgTree({ orgName: searchValue.value, orgId });
};
const tableFetch = (params) => {
console.log(params, 'sdfasfasdfasdfasdf');
tableConfig.value.params = {
...mainRef.value.params,
...params,
};
setTimeout(() => {
mainRef.value?.nsTableRef.reload();
}, 100);
};
const handleSelect = (selectedKeys: any, info: any) => {
fetch(carbonEmissionFactorLibrary.queryDeptTree, { orgId: info.node?.orgInfo.orgId }).then((res) => {
treeData2.value = res.data;
});
tableFetch({ orgId: info.node?.orgInfo.orgId });
};
const onClose = () => {
visible.value = false;
formData.value = {};
userAuthList.value.splice(0);
};
const onEdit = () => {
formRef.value?.triggerSubmit().then(() => {
console.log(formData.value, 'formData.value');
if (!userAuthList.value.length) {
NsMessage.error('请添加用户权限');
return;
}
opMap.value.fuc &&
opMap.value.fuc({ ...formData.value, userRoleList: userAuthList.value, orgId });
});
};
const tableConfig = ref({
title: '数据库',
api: carbonEmissionFactorLibrary.getTableList,
params: {
orgId,
},
headerActions: [
{
label: '新增',
name: 'userAdd',
type: 'primary',
handle: () => {
opMap.value.type = 'add';
setTimeout(() => {
formData.value = {
// orgName: JSON.parse(sessionStorage.getItem('userInfo')).orgName,
};
userAuthList.value.splice(0);
});
opMap.value.fuc = (formData: any) => {
return http.post(carbonEmissionFactorLibrary.addNewData, formData).then(() => {
mainRef.value?.nsTableRef.reload();
visible.value = false;
NsMessage.success('操作成功');
});
};
visible.value = true;
},
},
{
label: '导入',
type: 'primary',
name: 'userImport',
handle: () => {},
},
{
label: '导出',
type: 'primary',
name: 'userExports',
},
{
label: '批量删除',
type: 'primary',
name: 'userBatchDel',
dynamicDisabled: (data: any) => {
return data.list.length === 0;
},
confirm: true,
isReload: true,
isClearCheck: true,
api: carbonEmissionFactorLibrary.batchDel,
dynamicParams: { userIds: 'userId[]' },
},
],
columns: [
{
title: 'id',
dataIndex: 'address',
customRender: (text: any) => {
return text.index + 1;
},
},
{
title: '排放源',
dataIndex: 'emissionSources',
},
{
title: '排放类型',
dataIndex: 'emissionType',
},
{
title: '排放气体',
dataIndex: 'emissionGas',
},
{
title: '排放环节',
dataIndex: 'emissionProcess',
},
{
title: '排放因子',
dataIndex: 'emissionFactors',
},
{
title: '排放因子单位',
dataIndex: 'emissionFactorUnits',
},
{
title: '数据来源',
dataIndex: 'dataSources',
},
{
title: '数据库',
dataIndex: 'carbonDatabase',
},
{
title: '参考文献',
dataIndex: 'reference',
},
{
title: '引用数量',
dataIndex: 'numberOfReferences',
},
],
columnActions: {
title: '操作',
actions: [
{
label: '编辑',
name: 'userEdit',
handle: (record: any) => {
userAuthList.value.splice(0);
setTimeout(() => {
formData.value = record;
userAuthList.value.push(...record.userRoleInfos);
}, 10);
opMap.value.type = 'edit';
opMap.value.fuc = (formData: any) => {
return http.post(carbonEmissionFactorLibrary.editUser, formData).then(() => {
mainRef.value?.nsTableRef.reload();
visible.value = false;
NsMessage.success('操作成功');
});
};
visible.value = true;
},
},
{
label: '删除',
name: 'userDelete',
dynamicParams: 'userId',
confirm: true,
isReload: true,
api: carbonEmissionFactorLibrary.del,
},
],
},
formConfig: {
schemas: [
{
field: 'emissionSources',
label: '排放源',
component: 'NsInput',
componentProps: {
placeholder: '请输入排放源',
maxLength: 30,
},
},
{
field: 'userStatus',
label: '排放环节',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择排放环节',
options: [
{
label: '正常',
value: 0,
},
{
label: '冻结',
value: 1,
},
],
},
},
{
field: 'userStatus',
label: '排放气体',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择排放气体',
options: [
{
label: '正常',
value: 0,
},
{
label: '冻结',
value: 1,
},
],
},
},
{
field: 'userStatus',
label: '数据库名称',
component: 'NsSelect',
componentProps: {
allowClear: true,
placeholder: '请选择数据库名称',
options: [
{
label: '正常',
value: 0,
},
{
label: '冻结',
value: 1,
},
],
},
},
{
field: 'accountNo',
label: '文献关键字',
component: 'NsInput',
componentProps: {
placeholder: '请输入文献关键字',
maxLength: 30,
},
},
],
params: {},
},
// pagination: { defaultPageSize: 10 },
rowKey: 'userId',
});
</script>
<style lang="less" scoped>
.main {
background-color: @ns-content-bg;
display: flex;
}
.left {
width: 300px;
// max-height: calc(100vh - 96px);
margin-right: @ns-gap;
min-width: fit-content;
> div {
border-radius: @ns-border-radius;
background-color: @white;
// box-shadow: @ns-content-box-shadow;
flex: 1;
}
display: flex;
flex-direction: column;
.top{
position: relative;
.addTreeNode{
width: 100%;
padding: 16px;
position: absolute;
bottom: 0;
}
}
}
.right {
flex: 1;
min-width: 0;
}
.top {
overflow: auto;
// height: 50%;
// border-bottom: 5px solid rgb(229, 235, 240);
// overflow-y: auto;
}
.ns-form-title{
font-weight: bold;
user-select: text;
padding: 16px;
margin-bottom: 16px;
padding-bottom: 10px;
border-bottom: 1px solid #e9e9e9;
}
</style>

View File

@@ -0,0 +1,45 @@
import { ref } from 'vue';
import { origanizemanage } from '/@/api/origanizemanage';
import { http } from '/nerv-lib/saas';
export const mockData = ref([
{
id: 3,
zhanghao: 'axb',
name: '张三',
sex: '男',
phone: '123456789',
email: '1234567889',
relation: '1',
role: '1',
status: '1',
},
]);
export const mockData2 = ref([
{
information: '铁路局1/产品部1/产品总监1',
},
]);
export const treeData = ref([
{
title: '铁路总局',
key: '0-0',
children: [
{ title: '济阳站', key: '0-0-0' },
{ title: '临沂站', key: '0-0-1' },
],
},
]);
export const treeData2 = [
{
title: '全部',
key: '0-0',
children: [
{ title: '产品部', key: '0-0-0' },
{ title: '运维部', key: '0-0-1' },
],
},
];

View File

@@ -0,0 +1,105 @@
import { dateUtil } from '/nerv-lib/util/date-util';
import data from './mock.json';
export const tableConfig = {
title: '设备台账',
// api: '/carbon_emission/device/getDeviceList',
value: data.dataSource,
params: {
page: 0,
pageSize: 10,
},
rowSelection: null,
columns: [
{
title: '设备名称',
dataIndex: 'id',
},
{
title: '设备型号',
dataIndex: 'deviceCode',
},
{
title: 'SN码',
dataIndex: 'deviceName',
textNumber: 8,
textEllipsis: true,
},
{
title: '设备一级区域',
dataIndex: 'position',
},
{
title: '设备二级区域',
dataIndex: 'position',
},
{
title: '设备详细位置',
dataIndex: 'position',
},
{
title: '设备规格',
dataIndex: 'position',
},
{
title: '设备厂商纳税人识别号',
dataIndex: 'position',
},
{
title: '厂商联系人',
dataIndex: 'position',
},
{
title: '设备描述',
dataIndex: 'position',
},
{
title: 'IP地址',
dataIndex: 'position',
},
{
title: '生产日期',
dataIndex: 'position',
},
{
title: '采购日期',
dataIndex: 'position',
},
{
title: '启用日期',
dataIndex: 'position',
},
{
title: '设备成本(元)',
dataIndex: 'position',
},
{
title: '使用期限',
dataIndex: 'position',
},
{
title: '额定功率',
dataIndex: 'position',
},
{
title: '特殊参数',
dataIndex: 'position',
},
],
formConfig: {
schemas: [
{
field: 'createTime',
label: '生产日期',
component: 'NsRangePicker',
fieldMap: ['queryStartDate', 'queryEndDate'],
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
},
],
params: {},
},
// pagination: { pageSizeOptions: false },
rowKey: 'uuid',
};

View File

@@ -0,0 +1,18 @@
<template>
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="能耗统计">
<ns-view-list-table v-bind="tableConfig" />
</a-tab-pane>
<a-tab-pane key="2" tab="碳排统计" force-render>Content of Tab Pane 2</a-tab-pane>
<a-tab-pane key="3" tab="碳排速算">Content of Tab Pane 3</a-tab-pane>
</a-tabs>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { tableConfig } from './config';
defineOptions({
name: 'CarbonEmissionStatisticsIndex', // 与页面路由name一致缓存才可生效
});
const activeKey = ref('1');
</script>

View File

@@ -0,0 +1,506 @@
{
"data":[
{
"title": "家居照明",
"key": "1",
"children": [
{
"title": "灯泡",
"key": "1-1",
"children": [
{
"title": "LED灯泡",
"key": "1-1-1",
"children": [
{
"title": "E27 LED灯泡",
"key": "1-1-1-1",
"attr": {
"瓦特": "7W",
"光通量": "500lm",
"色温": "2700K"
}
},
{
"title": "E14 小灯泡",
"key": "1-1-1-2",
"attr": {
"瓦特": "4W",
"光通量": "250lm",
"色温": "6500K"
}
}
]
},
{
"title": "节能灯",
"key": "1-1-2",
"children": [
{
"title": "E27 节能灯泡",
"key": "1-1-2-1",
"attr": {
"瓦特": "11W",
"光通量": "800lm",
"色温": "6500K"
}
}
]
}
]
},
{
"title": "灯具",
"key": "1-2",
"children": [
{
"title": "吊灯",
"key": "1-2-1",
"children": [
{
"title": "水晶吊灯",
"key": "1-2-1-1",
"attr": {
"尺寸": "Φ60cm",
"适用面积": "15-20㎡"
}
},
{
"title": "现代简约吊灯",
"key": "1-2-1-2",
"attr": {
"尺寸": "Φ52cm",
"适用面积": "10-15㎡"
}
}
]
},
{
"title": "台灯",
"key": "1-2-2",
"children": [
{
"title": "护眼台灯",
"key": "1-2-2-1",
"attr": {
"瓦特": "18W",
"调光调色": "是"
}
},
{
"title": "折叠臂台灯",
"key": "1-2-2-2",
"attr": {
"瓦特": "14W",
"调光调色": "否"
}
}
]
}
]
},
{
"title": "开关插座",
"key": "1-3",
"children": [
{
"title": "智能开关",
"key": "1-3-1",
"children": [
{
"title": "触控式智能开关",
"key": "1-3-1-1",
"attr": {
"控制方式": "触控/远程",
"兼容性": "ZigBee/WiFi"
}
}
]
},
{
"title": "插座",
"key": "1-3-2",
"children": [
{
"title": "多功能插座",
"key": "1-3-2-1",
"attr": {
"插孔类型": "2/3插",
"USB接口": "有"
}
}
]
}
]
}
]
},
{
"title": "电梯",
"key": "3",
"children": [
{
"title": "扶梯",
"key": "301"
},
{
"title": "直梯",
"key": "302"
}
]
},
{
"title": "冷源源",
"key": "4",
"children": [
{
"title": "通风及空调设备",
"key": "5",
"children": [
{
"title": "组合式空调机组",
"key": "501"
},
{
"title": "新风机组",
"key": "502"
},
{
"title": "精密空调",
"key": "503"
},
{
"title": "风机盘管",
"key": "504"
},
{
"title": "VAV",
"key": "505"
},
{
"title": "室外多联机",
"key": "506"
},
{
"title": "风幕机",
"key": "507"
},
{
"title": "球喷",
"key": "508"
},
{
"title": "送风机",
"key": "509"
},
{
"title": "排风机",
"key": "510"
},
{
"title": "排风兼排烟机",
"key": "511"
},
{
"title": "通风机",
"key": "512"
},
{
"title": "风阀",
"key": "513"
},
{
"title": "风柱式空调",
"key": "514"
}
]
}
]
},
{
"title": "照明",
"key": "6",
"children": [
{
"title": "多功能传感器",
"key": "701"
},
{
"title": "照度传感器",
"key": "702"
},
{
"title": "噪声传感器",
"key": "703"
}
]
}
],
"dataSource":[
{
"id": "d4",
"isDel": "0",
"officesId": "84",
"deviceCode": "37430200143",
"deviceName": "地听测试电表",
"category": "1",
"type": "1001",
"energyCount": "1",
"serialNumber": "69",
"pidCode": null,
"brand": "",
"types": "",
"manufacturer": "elit non in",
"contacts": "ad reprehenderit",
"phonenumber": "34",
"position": "in esse commodo",
"activeState": "1",
"measurementDirection": "1",
"deviceMagnification": 62,
"deviceAccuracy": "89",
"frequency": "anim consequat irure",
"standardFrequency": "ut elit",
"deviceHead": "pariatur ex velit",
"constructor": "84566",
"voltageType": "cillum aliquip reprehenderit",
"pt": 61,
"ct": 64,
"communicationProtocol": "cupidatat nisi ea ad",
"ip": "",
"port": "",
"com": "",
"slaveAddress": "",
"dlt": "",
"conversionIdentifier": "48",
"multiplicationAdjustment": "1",
"accessMethod": "1",
"replacementFrequency": "0",
"dataDetail": "sit",
"insertTime": null,
"children": null,
"devicePointList": null,
"insertUser": null
},
{
"id": "d1",
"isDel": "0",
"officesId": "84",
"deviceCode": "37430200144",
"deviceName": "地听测试2",
"category": "1",
"type": "1001",
"energyCount": "1",
"serialNumber": "69",
"pidCode": null,
"brand": "",
"types": "",
"manufacturer": "elit non in",
"contacts": "ad reprehenderit",
"phonenumber": "34",
"position": "in esse commodo",
"activeState": "1",
"measurementDirection": "1",
"deviceMagnification": 62,
"deviceAccuracy": "89",
"frequency": "anim consequat irure",
"standardFrequency": "ut elit",
"deviceHead": "pariatur ex velit",
"constructor": "84566",
"voltageType": "cillum aliquip reprehenderit",
"pt": 61,
"ct": 64,
"communicationProtocol": "802",
"ip": "10.5.36.0",
"port": "6000",
"com": "",
"slaveAddress": "123测试",
"dlt": "",
"conversionIdentifier": "48",
"multiplicationAdjustment": "1",
"accessMethod": "1",
"replacementFrequency": "0",
"dataDetail": "sit",
"insertTime": "2024-02-28 11:26:58",
"children": null,
"devicePointList": null,
"insertUser": null
},
{
"id": "d2",
"isDel": "0",
"officesId": "84",
"deviceCode": "1235623",
"deviceName": "测试设备2",
"category": "1",
"type": "1001",
"energyCount": "是",
"serialNumber": "69",
"pidCode": null,
"brand": "",
"types": "",
"manufacturer": "elit non in",
"contacts": "ad reprehenderit",
"phonenumber": "34",
"position": "in esse commodo",
"activeState": "1",
"measurementDirection": "1",
"deviceMagnification": 62,
"deviceAccuracy": "89",
"frequency": "anim consequat irure",
"standardFrequency": "ut elit",
"deviceHead": "pariatur ex velit",
"constructor": null,
"voltageType": "cillum aliquip reprehenderit",
"pt": 61,
"ct": 64,
"communicationProtocol": "cupidatat nisi ea ad",
"ip": "",
"port": "",
"com": "",
"slaveAddress": "",
"dlt": "",
"conversionIdentifier": "48",
"multiplicationAdjustment": "1",
"accessMethod": "1",
"replacementFrequency": "0",
"dataDetail": "sit",
"insertTime": "2024-02-28 11:31:57",
"children": null,
"devicePointList": null,
"insertUser": null
},
{
"id": "d7",
"isDel": "0",
"officesId": "",
"deviceCode": "0213",
"deviceName": "测试",
"category": "1",
"type": "1001",
"energyCount": "1",
"serialNumber": "",
"pidCode": null,
"brand": "6da085e5-956d-4000-bd3c-ebb01a9c99a1",
"types": "d7a8aede-b821-4ff2-953d-601a20e5a948",
"manufacturer": "",
"contacts": "",
"phonenumber": null,
"position": "",
"activeState": "",
"measurementDirection": "",
"deviceMagnification": null,
"deviceAccuracy": null,
"frequency": "",
"standardFrequency": "",
"deviceHead": "",
"constructor": "",
"voltageType": "",
"pt": null,
"ct": null,
"communicationProtocol": "",
"ip": "",
"port": "",
"com": "",
"slaveAddress": "",
"dlt": "",
"conversionIdentifier": "1",
"multiplicationAdjustment": "1",
"accessMethod": "",
"replacementFrequency": "0",
"dataDetail": "",
"insertTime": "2024-03-14 20:01:53",
"children": null,
"devicePointList": null,
"insertUser": ""
},
{
"id": "d3",
"isDel": "0",
"officesId": "84",
"deviceCode": "81",
"deviceName": "设备名称1111",
"category": "1",
"type": "1001",
"energyCount": "1",
"serialNumber": "69",
"pidCode": null,
"brand": "6da085e5-956d-4000-bd3c-ebb01a9c99a1",
"types": "d7a8aede-b821-4ff2-953d-601a20e5a948",
"manufacturer": "elit non in",
"contacts": "ad reprehenderit",
"phonenumber": "34",
"position": "in esse commodo",
"activeState": "1",
"measurementDirection": "1",
"deviceMagnification": 62,
"deviceAccuracy": "89",
"frequency": "anim consequat irure",
"standardFrequency": "ut elit",
"deviceHead": "pariatur ex velit",
"constructor": "84566",
"voltageType": "cillum aliquip reprehenderit",
"pt": 61,
"ct": 64,
"communicationProtocol": "cupidatat nisi ea ad",
"ip": "",
"port": "",
"com": "",
"slaveAddress": "",
"dlt": "",
"conversionIdentifier": "48",
"multiplicationAdjustment": "1",
"accessMethod": "1",
"replacementFrequency": "0",
"dataDetail": "sit",
"insertTime": "2024-03-15 17:34:24",
"children": null,
"devicePointList": null,
"insertUser": null
},
{
"id": "d43fdfff_02_0001",
"isDel": "0",
"officesId": "843fdffff213d2d3",
"deviceCode": "00037430200143",
"deviceName": "应感者酸严",
"category": "1",
"type": "1001",
"energyCount": "esse consequat",
"serialNumber": "69",
"pidCode": null,
"brand": "",
"types": "",
"manufacturer": "elit non in",
"contacts": "ad reprehenderit",
"phonenumber": "34",
"position": "in esse commodo",
"activeState": "1",
"measurementDirection": "1",
"deviceMagnification": 62,
"deviceAccuracy": "89",
"frequency": "anim consequat irure",
"standardFrequency": "ut elit",
"deviceHead": "pariatur ex velit",
"constructor": "84566",
"voltageType": "cillum aliquip reprehenderit",
"pt": 61,
"ct": 64,
"communicationProtocol": "cupidatat nisi ea ad",
"ip": "",
"port": "",
"com": "",
"slaveAddress": "",
"dlt": "",
"conversionIdentifier": "48",
"multiplicationAdjustment": "1",
"accessMethod": "1",
"replacementFrequency": "0",
"dataDetail": "sit",
"insertTime": "2024-04-29 11:12:43",
"children": null,
"devicePointList": null,
"insertUser": null
}
]
}

View File

@@ -0,0 +1,159 @@
// 页面容器
.lighting-box {
// width: 100%;
// height: 100%;
position: relative;
// background: linear-gradient(#badaff, #8cabeb, #7095de);
.drawer-box {
width: 30px;
height: 40px;
border-radius: 2px;
position: fixed;
right: 0;
top: 0;
bottom: 0;
margin: auto;
background: rgba(0, 0 ,0 ,0.5);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
.drawer-icon {
}
}
// 照明设备功能总容器
.lighting-img-box {
position: relative;
width: 1280px;
height: 720px;
user-select: none;
background-image: url(../image/bg.jpg);
// 由于背景是俯视图,会产生有交点的透视效果,故使用透视属性
perspective: 1000px;
perspective-origin: 850px -160px;
// 左上角区域切换功能
.btn-box {
width: 120px;
position: sticky;
top: 10px;
left: 10px;
display: flex;
flex-direction: column;
gap: 8px;
.btn-item {
cursor: pointer;
width: 100%;
height: 40px;
border-radius: 4px;
background: rgba(39, 120, 255, 1);
border: 1px solid rgba(51, 199, 255, 1);
box-shadow: 0px 10px 15px rgba(0, 54, 136, 0.3);
font-size: 18px;
color: white;
}
.btn-item:hover {
color: black;
}
}
// 大区分区
.area{
position: absolute;
bottom: 170px;
left: 240px;
width: 780px;
height: 240px;
transform: rotateX(79deg) rotateZ(-22deg) skew(29deg);
display: flex;
gap: 8px;
.area1 {
width: 170px;
background: rgba(0, 251, 91, 0.3);
border: 2px solid rgb(0, 251, 91);
display: flex;
}
.area2 {
width: 240px;
background: rgba(255, 165, 0, 0.3);
border: 2px solid rgb(255, 165, 0);
display: flex;
}
.area3 {
width: 110px;
background: rgba(255, 0, 0, 0.3);
border: 2px solid rgb(255, 0, 0);
}
.area4 {
flex: 1;
background: rgba(80, 236, 244, 0.3);
border: 2px solid rgb(80, 236, 244);
}
.area-item:hover {
border:2px solid white;
}
.area-item {
cursor: pointer;
transition: all ease 0.2s;
>.light-group {
height: 100%;
flex: 1;
display:flex;
justify-content: center;
align-items: center;
.group-shadow1 {
width: 35px;
height: 150px;
border-radius: 20px;
background: rgba(0, 0, 0, 0.1);
}
.group-shadow2 {
width: 35px;
height: 180px;
border-radius: 20px;
background: rgba(0, 0, 0, 0.1);
}
.group-shadow3 {
width: 40px;
height: 180px;
border-radius: 20px;
background: rgba(0, 0, 0, 0.1);
}
.group-shadow4 {
width: 40px;
height: 160px;
border-radius: 20px;
background: rgba(0, 0, 0, 0.1);
}
}
.group-shadow {
transition: all ease 0.2s;
}
.group-shadow:hover {
border: 2px solid white;
}
}
}
}
}
.ns-content-main {
position: relative;
// 抽屉伸缩按钮
.drawer-box {
width: 30px;
height: 40px;
border-radius: 2px;
position: fixed;
right: 0;
top: 0;
bottom: 0;
margin: auto;
background: rgba(0, 0 ,0 ,0.5);
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
.drawer-icon {
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,135 @@
<template>
<a-popover color="rgba(0, 0, 0, 0.8)">
<template #content>
<div class="light-tag">
<div class="light-tag-tit">
<div>
<img src="/asset/image//bulbLogo/21962.png" alt="" />
<span class="tag-text">{{ result.name }}</span>
</div>
<button class="right-button">{{ type == 1 ? '正常' : '关闭' }}</button>
</div>
<div class="light-tag-box">
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制模式</span>
<span class="result">自动</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">亮度</span>
<span class="result">{{ result.brightness }}</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">控制场景</span>
<span class="result">{{ result.automatic2 }}</span>
</div>
<div class="tag-box-item">
<img src="/asset/image//bulbLogo/22496.png" alt="" />
<span class="title">色温</span>
<span class="result">{{ result.brightness3 }}</span>
</div>
</div>
</div>
</template>
<div class="icon-box" :style="styleObject">
<img v-if="type == 1" class="icon-item" src="/asset/image/bulbLogo/22394.png" alt="">
<img v-if="type == 2" class="icon-item" src="/asset/image/bulbLogo/22396.png" alt="">
<img v-if="type == 3" class="icon-item" src="/asset/image/bulbLogo/22400.png" alt="">
</div>
</a-popover>
</template>
<script setup lang="ts">
import { ref } from 'vue';
defineProps({
styleObject: Object,
type: Number
});
const result = ref({
id: '1',
name: '站厅照明 1区',
manual: '手动',
automatic: '自动',
brightness: '100lux',
brightness2: '30lux',
manual2: '手动',
automatic2: '舒适',
brightness3: '4000k',
brightness4: '3800k',
});
</script>
<style lang="less" scoped>
.icon-box {
width: 25px;
height: 25px;
position: absolute;
.icon-item {
width: 25px;
cursor: pointer;
transition: all ease 0.1s;
}
.icon-item:active {
transform: scale(1.2);
}
}
// 悬浮窗外部
.light-tag {
display: flex;
flex-direction: column;
gap: 10px;
// 悬浮窗标题
.light-tag-tit {
display: flex;
justify-content: space-between;
vertical-align: middle;
height: 30px;
.tag-text {
font-size: 16px;
font-weight: 700;
color: white;
padding-left: 10px;
}
.right-button {
width: 50px;
height: 26px;
background: rgba(57, 215, 187, 0.1);
border: 1px solid rgba(57, 215, 187, 1);
font-size: 12px;
color: rgba(57, 215, 187, 1);
}
}
}
// 悬浮窗底部4格子
.light-tag-box {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
grid-gap: 10px;
.tag-box-item {
position: relative;
display: flex;
justify-content: space-between;
img {
width: 120px;
vertical-align: middle;
}
.title {
position: absolute;
left: 60px;
top: 13px;
color: rgba(64, 255, 252, 1);
}
.result {
line-height: 50px;
font-size: 16px;
font-weight: 700;
color: white;
};
}
}
</style>

View File

@@ -0,0 +1,180 @@
import { dateUtil } from '/nerv-lib/util/date-util';
import data from './mock.json';
export const tableConfig = {
title: '设备台账',
// api: '/carbon_emission/device/getDeviceList',
value: data.dataSource,
treeConfig: {
header: {
icon: 'orgLink',
title: '设备类别',
},
defaultExpandAll: true,
api: () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(data);
}, 100);
});
},
formConfig: {
schemas: [
{
field: 'name',
label: '设备名称',
component: 'NsInput',
autoSubmit: true,
componentProps: {
placeholder: '请输入',
},
},
],
},
},
params: {
page: 0,
pageSize: 10,
},
rowSelection: null,
columns: [
{
title: '设备名称',
dataIndex: 'id',
},
{
title: '设备型号',
dataIndex: 'deviceCode',
},
{
title: 'SN码',
dataIndex: 'deviceName',
textNumber: 8,
textEllipsis: true,
},
{
title: '设备一级区域',
dataIndex: 'position',
},
{
title: '设备二级区域',
dataIndex: 'position',
},
{
title: '设备详细位置',
dataIndex: 'position',
},
{
title: '设备规格',
dataIndex: 'position',
},
{
title: '设备厂商纳税人识别号',
dataIndex: 'position',
},
{
title: '厂商联系人',
dataIndex: 'position',
},
{
title: '设备描述',
dataIndex: 'position',
},
{
title: 'IP地址',
dataIndex: 'position',
},
{
title: '生产日期',
dataIndex: 'position',
},
{
title: '采购日期',
dataIndex: 'position',
},
{
title: '启用日期',
dataIndex: 'position',
},
{
title: '设备成本(元)',
dataIndex: 'position',
},
{
title: '使用期限',
dataIndex: 'position',
},
{
title: '额定功率',
dataIndex: 'position',
},
{
title: '特殊参数',
dataIndex: 'position',
},
],
formConfig: {
schemas: [
{
field: 'name',
label: '设备名称',
component: 'NsInput',
componentProps: {
placeholder: '请输入',
},
},
{
field: 'provider',
label: '设备厂商',
component: 'NsInput',
componentProps: {
placeholder: '请输入',
},
},
{
field: 'payWay',
label: '设备区域',
component: 'NsSelect',
componentProps: {
placeholder: '请选择',
options: [
{
label: '全部',
value: '',
},
],
},
},
{
field: 'createTime',
label: '生产日期',
component: 'NsRangePicker',
fieldMap: ['queryStartDate', 'queryEndDate'],
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
},
{
field: 'createTime1',
label: '采购日期',
component: 'NsRangePicker',
fieldMap: ['queryStartDate', 'queryEndDate'],
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
},
{
field: 'createTime2',
label: '启用日期',
component: 'NsRangePicker',
fieldMap: ['queryStartDate', 'queryEndDate'],
componentProps: {
valueFormat: 'YYYY-MM-DD',
},
},
],
params: {},
},
// pagination: { pageSizeOptions: false },
rowKey: 'uuid',
};

View File

@@ -0,0 +1,210 @@
<template>
<div ref="chart" style="width: 100%; height: 80%;"></div>
</template>
<script lang="ts">
import { defineComponent, onMounted, ref, watch } from 'vue';
import * as echarts from 'echarts';
const data = [
{
date: '2023-12-01 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '21'
},
{
name: 'AC_003照明电表',
value: '36'
},
{
name: 'AC_004给排水电表',
value: '5'
}
]
},
{
date: '2023-12-02 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '26'
},
{
name: 'AC_003照明电表',
value: '25'
},
{
name: 'AC_004给排水电表',
value: '47'
}
]
},
{
date: '2023-12-03 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '18'
},
{
name: 'AC_003照明电表',
value: '22'
},
{
name: 'AC_004给排水电表',
value: '26'
}
]
},
{
date: '2023-12-04 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '40'
},
{
name: 'AC_003照明电表',
value: '15'
},
{
name: 'AC_004给排水电表',
value: '12'
}
]
},
{
date: '2023-12-05 0:00',
unit: 'V',
data: [
{
name: 'AC_002暖通电表',
value: '15'
},
{
name: 'AC_003照明电表',
value: '18'
},
{
name: 'AC_004给排水电表',
value: '15'
}
]
},
];
export default defineComponent({
name: 'Graph',
setup() {
const chart = ref(null);
onMounted(() => {
var seriesList = []
var date = []
var legendList: string|any[] = []
for (let i = 0; i < data.length; i++) {
date.push(data[i].date)
for (let j = 0; j < data[i].data.length; j++) {
if (seriesList.length < j + 1) {
seriesList.push(
{
name: data[i].data[j].name,
data: [data[i].data[j].value],
type: 'line',
smooth: true
}
)
} else {
seriesList[j].data.push(data[i].data[j].value)
}
if (legendList.length == 0 || legendList.length < j + 1) {
legendList.push(data[i].data[j].name)
}
}
}
const option = {
legend: {
data: legendList,
orient: 'horizontal',
bottom: 30
},
tooltip: {
trigger: 'axis',
formatter: (params: any) => {
const date = params[0].name;
const values = params.map((param: any) => {
const unit = data.find(d => d.date === date)?.unit || '';
return `<tr>
<td>${param.marker}${param.seriesName}</td>
<td style="text-align: right;">${param.value} ${unit}</td>
</tr>`;
}).join('');
return `<div>${date}</div><table style="width: 100%;">${values}</table>`;
}
},
xAxis: {
type: 'category',
data: date
},
yAxis: {
type: 'value'
},
dataZoom: [
// {
// type: 'inside',
// start: 0,
// end: 10
// },
{
height: 10,
start: 0,
end: 100,
handleSize: '300%', // 设置滑块的大小
bottom: 15,
}
],
series: seriesList
// series: [
// {
// data: [820, 932, 901, 934, 1290, 1330, 1320],
// type: 'line'
// }
// ]
};
const chartInstance = echarts.init(chart.value);
chartInstance.setOption(option);
});
return { chart };
}
})
</script>
<style lang="less" scoped>
</style>

View File

@@ -0,0 +1,76 @@
<template>
<a-row type="flex">
<a-col :span="4">
<div style="padding: 0 20px; width: 100%; height: 100%;">
<tree ref="treeRef"></tree>
</div>
</a-col>
<a-col :span="20">
<div style="width: 100%; height: 100%;">
<div class="ns-right-title">
<span>历史数据</span>
<div class="button">
<ns-icon name="biaoge" size="18" style="margin-right: 10px;"/>
<ns-icon :name="iconName" size="18" style="margin-right: 10px;" @click="change"/>
</div>
</div>
<graph ref="graphRef" v-if="isGraph"></graph>
<environment-table ref="tableRef" v-else></environment-table>
</div>
</a-col>
</a-row>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import tree from './tree/index.vue';
import graph from './graph/index.vue';
import environmentTable from './table/index.vue';
const iconName = ref('biaoge');
const treeRef = ref();
const graphRef = ref();
const tableRef = ref();
let isGraph = ref(true)
defineOptions({
name: 'EnvironmentMonitorIndex', // 与页面路由name一致缓存才可生效
});
function change() {
isGraph.value = !isGraph.value
if (iconName.value == 'biaoge') {
iconName.value = 'bingtu'
} else {
iconName.value = 'biaoge'
}
}
</script>
<style lang="less" scoped>
.ns-right-title {
display: flex;
justify-content: space-between;
align-items: center;
user-select: text;
margin-bottom: 5px;
padding-bottom: 10px;
padding-top: 10px;
border-bottom: 1px solid #e9e9e9;
> span {
padding-left: 10px;
line-height: 20px;
}
}
.button {
display: inline-block;
padding-right: 10px;
}
</style>

View File

@@ -0,0 +1,186 @@
<template>
<a-table :columns="columns" :data-source="data" bordered />
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import type { TableColumnType } from 'ant-design-vue';
const data = [
{
key: '1',
name: 'AC_002暖通电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
{
key: '1',
name: 'AC_002暖通电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
{
key: '2',
name: 'AC_003照明电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
{
key: '2',
name: 'AC_003照明电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
{
key: '3',
name: 'AC_004给排水电表',
position: 'A 相电压',
unit: 'V',
date: '2023-12-01',
'1:00': '3626',
},
];
export default defineComponent({
name: 'EnvironmentTable',
setup() {
const getRowSpan = (dataIndex: string, record, data, dependents: string[] = []) => {
let rowSpan = 1;
for (let i = data.indexOf(record) + 1; i < data.length; i++) {
let shouldMerge = true;
for (const dependent of dependents) {
if (data[i][dependent] !== record[dependent]) {
shouldMerge = false;
break;
}
}
if (shouldMerge && data[i][dataIndex] === record[dataIndex]) {
rowSpan++;
} else {
break;
}
}
return rowSpan;
};
const columns: TableColumnType[] = [
{
title: '序号',
dataIndex: 'key',
customCell: (record, rowIndex) => {
const rowSpan = getRowSpan('name', record, data);
if (rowIndex != 0 && data[rowIndex-1].key == record.key) {
return {
rowSpan: 0,
colSpan: 0,
}
}
return {
rowSpan: rowSpan,
};
},
},
{
title: '设备名称',
dataIndex: 'name',
customCell: (record, rowIndex) => {
const rowSpan = getRowSpan('name', record, data);
if (rowIndex != 0 && data[rowIndex-1].name == record.name) {
return {
rowSpan: 0,
colSpan: 0,
}
}
return {
rowSpan: rowSpan,
};
// if (rowIndex === data.indexOf(record)) {
// return {
// rowSpan: rowSpan,
// };
// }
// return {
// rowSpan: 0,
// colSpan: 0,
// };
},
},
{
title: '设备点位',
dataIndex: 'position',
customCell: (record, rowIndex) => {
const rowSpan = getRowSpan('position', record, data, ['name']);
if (rowIndex != 0 && data[rowIndex-1].name == record.name && data[rowIndex-1].position == record.position) {
return {
rowSpan: 0,
colSpan: 0,
}
}
return {
rowSpan: rowSpan,
};
// if (rowIndex === data.indexOf(record)) {
// return {
// rowSpan: rowSpan,
// };
// }
// return {
// rowSpan: 0,
// colSpan: 0,
// };
},
},
{
title: '计量单位',
dataIndex: 'unit',
customCell: (record, rowIndex) => {
const rowSpan = getRowSpan('unit', record, data, ['name', 'position']);
if (rowIndex != 0 && data[rowIndex-1].name == record.name && data[rowIndex-1].position == record.position && data[rowIndex-1].unit == record.unit) {
return {
rowSpan: 0,
colSpan: 0,
}
}
return {
rowSpan: rowSpan,
};
// if (rowIndex === data.indexOf(record)) {
// return {
// rowSpan: rowSpan,
// };
// }
// return {
// rowSpan: 0,
// colSpan: 0,
// };
},
},
{
title: '日期',
dataIndex: 'date',
},
{
title: '1:00',
dataIndex: '1:00',
},
];
return {
data,
columns,
};
},
});
</script>
<style lang="less" scoped></style>

View File

@@ -0,0 +1,225 @@
<template>
<div class="parent-container">
<div class="ns-tree-title">
<span>设备列表</span>
</div>
<a-tree-select
v-model:value="value"
style="width: 100%"
:tree-line="treeLine && { showLeafIcon }"
:tree-data="treeData1"
>
<!-- <template #title="{ value: val, title }">
<b v-if="val === 'parent 1-1'" style="color: #08c">sss</b>
<template v-else>{{ title }}</template>
</template> -->
</a-tree-select>
<a-tree
v-model:expandedKeys="expandedKeys"
v-model:selectedKeys="selectedKeys"
v-model:checkedKeys="checkedKeys"
checkable
style="width: 100%; margin-bottom: 10px;"
:tree-data="treeData2"
>
<!-- <template #title="{ title, key }">
<span v-if="key === '0-0-1-0'" style="color: #1890ff">{{ title }}</span>
<template v-else>{{ title }}</template>
</template> -->
</a-tree>
<div class="fixed-bottom">
<a-divider />
<a-select
ref="select"
v-model:value="selectedValue"
placeholder="请选择点位"
style="width: 100%; margin-bottom: 10px;"
:options="options1"
></a-select>
<a-select
v-model:value="frequencyValue"
placeholder="请选择频率"
style="width: 100%; margin-bottom: 10px;"
:options="options2"
></a-select>
<a-range-picker v-model:value="dateRange" style="width: 100%; margin-bottom: 10px;" :placeholder="['请选择日期','请选择日期']"/>
<a-button type="primary" style="width: 100%; margin-bottom: 10px;" @click="getDianWeiList">查询</a-button>
</div>
</div>
</template>
<script lang="ts">
import type { TreeSelectProps, TreeProps, SelectProps } from 'ant-design-vue';
import { defineComponent, ref, watch ,onMounted } from 'vue';
import dayjs, { Dayjs } from 'dayjs';
const treeData2: TreeProps['treeData'] = [
{
title: 'AC_001(总电表)',
key: '1',
children: [
{
title: 'AC_002(暖通电表)',
key: '2',
},
{
title: 'AC_003(照明电表)',
key: '3',
},
{
title: 'AC_004(给排水电表)',
key: '4',
},
{
title: 'AC_005(通风电表)',
key: '5',
},
{
title: 'AC_006(电动门电表)',
key: '6',
},
],
},
];
export default defineComponent({
name: 'Tree',
setup() {
const treeLine = ref(true);
const showLeafIcon = ref(false);
const value = ref<string>();
const treeData1 = ref<TreeSelectProps['treeData']>([
{
title: '3.电梯',
value: '3',
children: [
{
title: '301.扶梯',
value: '301',
},
{
title: '302.直梯',
value: '302',
},
],
},
{
title: '4.冷热源',
value: '4',
children: [
{
title: '401.冷水机组',
value: '401',
},
{
title: '402.热泵机组',
value: '402',
},
{
title: '403.锅炉',
value: '403',
},
{
title: '404.水处理机组',
value: '404',
},
],
},
]);
const expandedKeys = ref<string[]>(['0-0-0', '0-0-1']);
const selectedKeys = ref<string[]>(['0-0-0', '0-0-1']);
const checkedKeys = ref<string[]>(['0-0-0', '0-0-1']);
const options1 = ref<SelectProps['options']>([]);
const options2 = ref<SelectProps['options']>([
{
value: '1',
label: '5分钟',
},
{
value: '2',
label: '10分钟',
},
{
value: '3',
label: '30分钟',
},
{
value: '4',
label: '1小时',
},
]);
const selectedValue = ref<string | undefined>();
const frequencyValue = ref<string | undefined>();
const dateRange = ref<[Dayjs, Dayjs] | undefined>();
const getDianWeiList = () => {
console.log('getDianWeiList 被调用');
options1.value = [
{ value: '1', label: 'A 项电压' },
{ value: '2', label: 'B 项电压' },
{ value: '3', label: 'C 项电压' },
{ value: '4', label: 'AB 线电压' },
{ value: '5', label: 'BC 线电压' },
{ value: '6', label: 'A 项电流' },
{ value: '7', label: 'B 项电流' },
];
};
onMounted(() => {
getDianWeiList();
});
const dateFormat = 'YYYY-MM-DD';
return {
treeLine,
showLeafIcon,
value,
treeData1,
treeData2,
expandedKeys,
selectedKeys,
checkedKeys,
options1,
options2,
selectedValue,
frequencyValue,
dateRange,
getDianWeiList,
};
},
});
</script>
<style lang="less" scoped>
.ns-tree-title {
user-select: text;
margin-bottom: 5px;
padding-bottom: 10px;
padding-top: 10px;
border-bottom: 1px solid #e9e9e9;
> span {
padding-left: 10px;
line-height: 20px;
}
}
.parent-container {
position: relative;
height: 100%;
}
.fixed-bottom {
position: absolute;
bottom: 0;
width: 100%;
margin-bottom: 10px;
}
</style>

View File

@@ -16,5 +16,9 @@ const proxy = {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/carbon-smart/, ''),
},
'/carbon': {
target: 'http://192.168.11.169:8224',
changeOrigin: true
},
};
export default configFun({ dirname, proxy, serviceMode: 'saas', baseDir: '../' });

View File

@@ -141,16 +141,6 @@
<span class="text-ellipsis" v-else> - </span>
</span>
</template>
<!-- 添加关闭按钮 -->
<template v-if="data.column.dataIndex === 'isUse'">
<a-switch
v-model:checked="data.record.isUse"
:class="{
'blue-background': data.record.isUse,
'grey-background': !data.record.isUse,
}"
@click="clickSwitch({ isUse: data.record.isUse, record: data.record })" />
</template>
<template v-if="data.column.dataIndex === 'tableAction'">
<ns-table-action
:data="data.record"
@@ -360,10 +350,6 @@
page: 1,
});
}, 300);
/* 点击开关按钮 */
const clickSwitch = (data: object) => {
emit('switch', data);
};
function setLoading(loading: boolean) {
tableState.loading = loading;
@@ -647,7 +633,6 @@
tableState,
isEmpty,
formFinish,
clickSwitch,
tableChangeEvent,
treeSelect,
getTreeBindValue,