Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp
This commit is contained in:
@@ -9,6 +9,13 @@ export enum lightingManage {
|
|||||||
// 修改线路的可用/禁用状态
|
// 修改线路的可用/禁用状态
|
||||||
setDisable = '/carbon-smart/IlluminationInfo/revisePanel',
|
setDisable = '/carbon-smart/IlluminationInfo/revisePanel',
|
||||||
|
|
||||||
|
// 控制面板tab页 ================================================
|
||||||
|
|
||||||
|
// 获取当前修改的内容对比数据
|
||||||
|
getChangeList = '/carbon-smart/IlluminationInfo/getLightSceneChangeInfo',
|
||||||
|
// 提交当前修改
|
||||||
|
submitChangeList = '/carbon-smart/IlluminationInfo/changeLightScene',
|
||||||
|
|
||||||
// 计划列表tab页 ================================================
|
// 计划列表tab页 ================================================
|
||||||
|
|
||||||
// 获得计划列表tab页的表格数据
|
// 获得计划列表tab页的表格数据
|
||||||
|
|||||||
@@ -55,4 +55,6 @@ export enum carbonInventoryCheck {
|
|||||||
findUnitById = '/carbon-smartapi/carbon/inventory/findById',
|
findUnitById = '/carbon-smartapi/carbon/inventory/findById',
|
||||||
getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList',
|
getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList',
|
||||||
updateTable = '/carbon-smart/api/carbon/inventory/details/update',
|
updateTable = '/carbon-smart/api/carbon/inventory/details/update',
|
||||||
}
|
// 排放统计接口
|
||||||
|
emissionStatistic = '/carbon-smart/api/carbon/inventory/emissionStatistic',
|
||||||
|
}
|
||||||
|
|||||||
@@ -50,14 +50,13 @@ export const getAllEnum = async ({
|
|||||||
return Promise.resolve(res);
|
return Promise.resolve(res);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取单个枚举(需传参,参数 enumType)
|
* 获取单个枚举(需传参,参数 enumType)
|
||||||
*/
|
*/
|
||||||
export const getEnum = async ({
|
export const getEnum = async ({
|
||||||
api = `${BASE_URL}/operation/enum/getEnum`,
|
api = `${BASE_URL}/operation/enum/getEnum`,
|
||||||
params = {},
|
params = {},
|
||||||
}: dictHttpConfig) => {
|
}: dictHttpConfig) => {
|
||||||
const res = await http.post(api, params);
|
const res = await http.get(api, params);
|
||||||
return Promise.resolve(res);
|
return Promise.resolve(res);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<a-tag class="card-title-tag" :color="item.color">{{ item.stateName }}</a-tag>
|
<a-tag class="card-title-tag" :color="item.color">{{ item.stateName }}</a-tag>
|
||||||
<div class="name">{{ item.createName }}</div>
|
<div class="name">{{ item.realName }}</div>
|
||||||
<div class="time">{{ item.createTime }}</div>
|
<div class="time">{{ item.createTime }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto">
|
<div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto">
|
||||||
|
|||||||
@@ -65,6 +65,26 @@ const equipment = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'carbonInventoryCheck',
|
||||||
|
name: 'CarbonInventoryCheck',
|
||||||
|
meta: { title: '碳资产', hideChildren: true, icon: 'tanpaiguanli' },
|
||||||
|
component: Base,
|
||||||
|
redirect: { name: 'CarbonInventoryCheckIndex' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'index',
|
||||||
|
name: 'CarbonInventoryCheckIndex',
|
||||||
|
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
|
||||||
|
component: () => import('/@/view/carbonEmissionManage/carbonInventoryCheck/index.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '碳资产',
|
||||||
|
keepAlive: false,
|
||||||
|
// backApi: [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
export default equipment;
|
export default equipment;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item-box-right">
|
<div class="item-box-right">
|
||||||
<img width="54px" height="54px" src="../../../../src/icon/gaojingtonglan.svg" />
|
<img width="48px" height="48px" src="../../../../src/icon/gaojingtonglan.svg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -288,7 +288,7 @@
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
params: { energyConsumptionAlarmId: value.id },
|
params: { energyConsumptionAlarmId: value.id, orgId: orgId.value },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
<a-select
|
<a-select
|
||||||
v-model:value="infoObject.alarmList[index - 1].logic"
|
v-model:value="infoObject.alarmList[index - 1].logic"
|
||||||
style="width: 70px; margin-left: 12px"
|
style="width: 70px; margin-left: 12px"
|
||||||
:options="ljOptions" />
|
:options="logicEnum" />
|
||||||
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
|
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
|
||||||
<a-input
|
<a-input
|
||||||
style="width: 65px; margin-left: 6px"
|
style="width: 65px; margin-left: 6px"
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
import { device, group } from '/@/api/deviceManage';
|
import { device, group } from '/@/api/deviceManage';
|
||||||
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
import { dict } from '/@/api';
|
import { dict, getEnum } from '/@/api';
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
//父级数据
|
//父级数据
|
||||||
@@ -256,13 +256,7 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
//逻辑
|
//逻辑
|
||||||
const ljOptions = ref<SelectProps['options']>([
|
const logicEnum = ref<SelectProps['options']>([]);
|
||||||
{ value: 0, label: '≥' },
|
|
||||||
{ value: 1, label: '>' },
|
|
||||||
{ value: 2, label: '≤' },
|
|
||||||
{ value: 3, label: '<' },
|
|
||||||
{ value: 4, label: '=' },
|
|
||||||
]);
|
|
||||||
//开关
|
//开关
|
||||||
const clickSwitch = () => {
|
const clickSwitch = () => {
|
||||||
if (infoObject.value.enableRules === 1) {
|
if (infoObject.value.enableRules === 1) {
|
||||||
@@ -273,6 +267,8 @@
|
|||||||
};
|
};
|
||||||
//父调子 页面显示方法
|
//父调子 页面显示方法
|
||||||
const toggle = async (value: any, info: any) => {
|
const toggle = async (value: any, info: any) => {
|
||||||
|
let enumData = await getEnum({ params: { enumType: 'LogicEnum' } });
|
||||||
|
logicEnum.value = enumData.data;
|
||||||
// 数据来源
|
// 数据来源
|
||||||
let energyType = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
|
let energyType = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
|
||||||
if (energyType.data.data) {
|
if (energyType.data.data) {
|
||||||
@@ -394,6 +390,9 @@
|
|||||||
formRef.value.validate().then(() => {
|
formRef.value.validate().then(() => {
|
||||||
//处理数据
|
//处理数据
|
||||||
let data = { ...infoObject.value };
|
let data = { ...infoObject.value };
|
||||||
|
if (!data.orgId) {
|
||||||
|
data.orgId = orgId.value;
|
||||||
|
}
|
||||||
//关联能耗告警id
|
//关联能耗告警id
|
||||||
data.energyConsumptionAlarmId = energyAlarm.value.id;
|
data.energyConsumptionAlarmId = energyAlarm.value.id;
|
||||||
data.errorCode = energyAlarm.value.errorCode;
|
data.errorCode = energyAlarm.value.errorCode;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
placeholder="请选择告警频率"
|
placeholder="请选择告警频率"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
allowClear
|
allowClear
|
||||||
:options="alarmFrequencyData"
|
:options="AlarmFrequencyEnum"
|
||||||
@change="handleChangeAlarmFrequency" />
|
@change="handleChangeAlarmFrequency" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
placeholder="请选择优先级"
|
placeholder="请选择优先级"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
allowClear
|
allowClear
|
||||||
:options="priorityData" />
|
:options="PriorityEnum" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="监测频率" name="monitorFrequency">
|
<a-form-item label="监测频率" name="monitorFrequency">
|
||||||
<a-select
|
<a-select
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
placeholder="请选择监测频率"
|
placeholder="请选择监测频率"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
allowClear
|
allowClear
|
||||||
:options="monitorFrequencyData" />
|
:options="MonitorFrequencyEnumm" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="启用规则">
|
<a-form-item label="启用规则">
|
||||||
<a-switch
|
<a-switch
|
||||||
@@ -79,6 +79,7 @@
|
|||||||
import { NsMessage } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
||||||
|
import { getAllEnum } from '/@/api';
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
// 间隔单位 默认值
|
// 间隔单位 默认值
|
||||||
@@ -87,6 +88,11 @@
|
|||||||
infoObject.value.intervalDurationUnit = 1;
|
infoObject.value.intervalDurationUnit = 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
//组织id
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
|
|
||||||
//表单数据
|
//表单数据
|
||||||
const infoObject = ref({
|
const infoObject = ref({
|
||||||
alarmTitle: null,
|
alarmTitle: null,
|
||||||
@@ -94,74 +100,16 @@
|
|||||||
priority: null,
|
priority: null,
|
||||||
monitorFrequency: null,
|
monitorFrequency: null,
|
||||||
createWorkOrder: null,
|
createWorkOrder: null,
|
||||||
|
orgId: null,
|
||||||
enableRules: 0,
|
enableRules: 0,
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const emit = defineEmits(['editObject']);
|
const emit = defineEmits(['editObject']);
|
||||||
const alarmFrequencyData = ref([
|
//告警频率 优先级 监测频率
|
||||||
{
|
const AlarmFrequencyEnum = ref([]);
|
||||||
label: '单次',
|
const PriorityEnum = ref([]);
|
||||||
value: 1,
|
const intervalDurationUnitData = ref([]);
|
||||||
},
|
const MonitorFrequencyEnumm = ref([]);
|
||||||
{
|
|
||||||
label: '重复',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '累计',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const priorityData = ref([
|
|
||||||
{
|
|
||||||
label: '紧急',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '重要',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '一般',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const intervalDurationUnitData = ref([
|
|
||||||
{
|
|
||||||
label: '分',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '时',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '天',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const monitorFrequencyData = ref([
|
|
||||||
{
|
|
||||||
label: '小时',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '每日',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '每周',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '月度',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '年度',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const rules = {
|
const rules = {
|
||||||
alarmTitle: [
|
alarmTitle: [
|
||||||
{
|
{
|
||||||
@@ -214,12 +162,29 @@
|
|||||||
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
|
priority: [{ required: true, message: '请选择优先级', trigger: 'change' }],
|
||||||
monitorTimeUnit: [{ required: true, message: '请选择监测时长单位', trigger: 'change' }],
|
monitorTimeUnit: [{ required: true, message: '请选择监测时长单位', trigger: 'change' }],
|
||||||
};
|
};
|
||||||
|
const getMenu = async () => {
|
||||||
|
let enumData = await getAllEnum({
|
||||||
|
params: [
|
||||||
|
'PriorityEnum',
|
||||||
|
'MonitorFrequencyEnumm',
|
||||||
|
'AlarmFrequencyEnum',
|
||||||
|
'IntervalDurationUnitEnum',
|
||||||
|
],
|
||||||
|
});
|
||||||
|
PriorityEnum.value = enumData.data.PriorityEnum;
|
||||||
|
MonitorFrequencyEnumm.value = enumData.data.MonitorFrequencyEnumm;
|
||||||
|
AlarmFrequencyEnum.value = enumData.data.AlarmFrequencyEnum;
|
||||||
|
intervalDurationUnitData.value = enumData.data.IntervalDurationUnitEnum;
|
||||||
|
};
|
||||||
const toggle = (value: any) => {
|
const toggle = (value: any) => {
|
||||||
|
//获取枚举 回显
|
||||||
|
getMenu();
|
||||||
//判断 是新增 还是修改
|
//判断 是新增 还是修改
|
||||||
if (value) {
|
if (value) {
|
||||||
infoObject.value = value;
|
infoObject.value = value;
|
||||||
} else {
|
} else {
|
||||||
infoObject.value = {
|
infoObject.value = {
|
||||||
|
orgId: null,
|
||||||
alarmTitle: null,
|
alarmTitle: null,
|
||||||
alarmFrequency: null,
|
alarmFrequency: null,
|
||||||
priority: null,
|
priority: null,
|
||||||
@@ -245,6 +210,9 @@
|
|||||||
//表单校验
|
//表单校验
|
||||||
formRef.value.validate().then(() => {
|
formRef.value.validate().then(() => {
|
||||||
let data = { ...infoObject.value };
|
let data = { ...infoObject.value };
|
||||||
|
if (!data.orgId) {
|
||||||
|
data.orgId = orgId.value;
|
||||||
|
}
|
||||||
data.createWorkOrder = Number(data.createWorkOrder);
|
data.createWorkOrder = Number(data.createWorkOrder);
|
||||||
if (data.alarmFrequency !== 2) {
|
if (data.alarmFrequency !== 2) {
|
||||||
data.repetitions = null;
|
data.repetitions = null;
|
||||||
|
|||||||
@@ -279,7 +279,7 @@
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
params: { equipmentAlarmId: value.id },
|
params: { equipmentAlarmId: value.id, orgId: orgId.value },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
placeholder="请选择取值类型"
|
placeholder="请选择取值类型"
|
||||||
allow-clear
|
allow-clear
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:options="qzOptions" />
|
:options="valueTypeEnum" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="异常描述" name="abnormalDescription">
|
<a-form-item label="异常描述" name="abnormalDescription">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
<a-select
|
<a-select
|
||||||
v-model:value="infoObject.alarmList[index - 1].logic"
|
v-model:value="infoObject.alarmList[index - 1].logic"
|
||||||
style="width: 70px; margin-left: 12px"
|
style="width: 70px; margin-left: 12px"
|
||||||
:options="ljOptions" />
|
:options="logicEnum" />
|
||||||
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
|
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
|
||||||
<a-input
|
<a-input
|
||||||
style="width: 65px; margin-left: 6px"
|
style="width: 65px; margin-left: 6px"
|
||||||
@@ -158,6 +158,7 @@
|
|||||||
import { device } from '/@/api/deviceManage';
|
import { device } from '/@/api/deviceManage';
|
||||||
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
|
import { getAllEnum } from '/@/api';
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
// 父级数据
|
// 父级数据
|
||||||
@@ -241,18 +242,9 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
//取值类型
|
//取值类型
|
||||||
const qzOptions = ref<SelectProps['options']>([
|
const valueTypeEnum = ref<SelectProps['options']>();
|
||||||
{ value: 1, label: '实时值' },
|
|
||||||
{ value: 2, label: '平均值' },
|
|
||||||
]);
|
|
||||||
//逻辑
|
//逻辑
|
||||||
const ljOptions = ref<SelectProps['options']>([
|
const logicEnum = ref<SelectProps['options']>([]);
|
||||||
{ value: 0, label: '≥' },
|
|
||||||
{ value: 1, label: '>' },
|
|
||||||
{ value: 2, label: '≤' },
|
|
||||||
{ value: 3, label: '<' },
|
|
||||||
{ value: 4, label: '=' },
|
|
||||||
]);
|
|
||||||
|
|
||||||
//开关
|
//开关
|
||||||
const clickSwitch = () => {
|
const clickSwitch = () => {
|
||||||
@@ -299,10 +291,16 @@
|
|||||||
}
|
}
|
||||||
return null; // 没有找到目标节点,返回 null
|
return null; // 没有找到目标节点,返回 null
|
||||||
};
|
};
|
||||||
|
const getMenu = async () => {
|
||||||
|
let enumData = await getAllEnum({ params: ['LogicEnum', 'ValueTypeEnum'] });
|
||||||
|
logicEnum.value = enumData.data.LogicEnum;
|
||||||
|
valueTypeEnum.value = enumData.data.ValueTypeEnum;
|
||||||
|
};
|
||||||
//父调子 页面显示方法
|
//父调子 页面显示方法
|
||||||
const toggle = async (value: any, info: any) => {
|
const toggle = async (value: any, info: any) => {
|
||||||
equipmentAlarm.value = info;
|
equipmentAlarm.value = info;
|
||||||
|
//获取枚举 回显
|
||||||
|
getMenu();
|
||||||
//获取设备类型
|
//获取设备类型
|
||||||
await http
|
await http
|
||||||
.post(device.queryDeviceTree, { orgId: orgId.value, pageNum: 1, pageSize: 10 })
|
.post(device.queryDeviceTree, { orgId: orgId.value, pageNum: 1, pageSize: 10 })
|
||||||
@@ -412,6 +410,9 @@
|
|||||||
//数据是否验证通过
|
//数据是否验证通过
|
||||||
formRef.value.validate().then(() => {
|
formRef.value.validate().then(() => {
|
||||||
let data = { ...infoObject.value };
|
let data = { ...infoObject.value };
|
||||||
|
if (!data.orgId) {
|
||||||
|
data.orgId = orgId.value;
|
||||||
|
}
|
||||||
// 配置关联id
|
// 配置关联id
|
||||||
data.equipmentAlarmId = equipmentAlarm.value.id;
|
data.equipmentAlarmId = equipmentAlarm.value.id;
|
||||||
// 逻辑列表
|
// 逻辑列表
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
placeholder="请选择监测时长单位"
|
placeholder="请选择监测时长单位"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
allowClear
|
allowClear
|
||||||
:options="monitorTimeUnitData" />
|
:options="MonitorTimeUnitEnum" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="告警频率" name="alarmFrequency">
|
<a-form-item label="告警频率" name="alarmFrequency">
|
||||||
<a-select
|
<a-select
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
placeholder="请选择告警频率"
|
placeholder="请选择告警频率"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
allowClear
|
allowClear
|
||||||
:options="alarmFrequencyData"
|
:options="AlarmFrequencyEnum"
|
||||||
@change="handleChangeAlarmFrequency" />
|
@change="handleChangeAlarmFrequency" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
<a-form-item v-if="infoObject.alarmFrequency === 2" name="repetitions" label="重复次数">
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
placeholder="请选择间隔时长单位"
|
placeholder="请选择间隔时长单位"
|
||||||
style="width: 80px"
|
style="width: 80px"
|
||||||
allowClear
|
allowClear
|
||||||
:options="intervalDurationUnitData" />
|
:options="IntervalDurationUnitEnum" />
|
||||||
</template>
|
</template>
|
||||||
</ns-input-number>
|
</ns-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
placeholder="请选择优先级"
|
placeholder="请选择优先级"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
allowClear
|
allowClear
|
||||||
:options="priorityData" />
|
:options="PriorityEnum" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="启用规则">
|
<a-form-item label="启用规则">
|
||||||
<a-switch
|
<a-switch
|
||||||
@@ -85,8 +85,13 @@
|
|||||||
import { NsMessage } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
||||||
|
import { getAllEnum } from '/@/api';
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
|
//组织id
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
//表单数据
|
//表单数据
|
||||||
const infoObject = ref({
|
const infoObject = ref({
|
||||||
id: null,
|
id: null,
|
||||||
@@ -103,63 +108,27 @@
|
|||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const emit = defineEmits(['editObject']);
|
const emit = defineEmits(['editObject']);
|
||||||
const alarmFrequencyData = ref([
|
const AlarmFrequencyEnum = ref([]);
|
||||||
{
|
const MonitorTimeUnitEnum = ref([]);
|
||||||
label: '单次',
|
const IntervalDurationUnitEnum = ref([]);
|
||||||
value: 1,
|
const PriorityEnum = ref([]);
|
||||||
},
|
const getMenu = async () => {
|
||||||
{
|
let enumData = await getAllEnum({
|
||||||
label: '重复',
|
params: [
|
||||||
value: 2,
|
'PriorityEnum',
|
||||||
},
|
'MonitorTimeUnitEnum',
|
||||||
{
|
'AlarmFrequencyEnum',
|
||||||
label: '累计',
|
'IntervalDurationUnitEnum',
|
||||||
value: 3,
|
],
|
||||||
},
|
});
|
||||||
]);
|
PriorityEnum.value = enumData.data.PriorityEnum;
|
||||||
const monitorTimeUnitData = ref([
|
MonitorTimeUnitEnum.value = enumData.data.MonitorTimeUnitEnum;
|
||||||
{
|
AlarmFrequencyEnum.value = enumData.data.AlarmFrequencyEnum;
|
||||||
label: '分',
|
IntervalDurationUnitEnum.value = enumData.data.IntervalDurationUnitEnum;
|
||||||
value: 1,
|
};
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '时',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '天',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const intervalDurationUnitData = ref([
|
|
||||||
{
|
|
||||||
label: '分',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '时',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '天',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const priorityData = ref([
|
|
||||||
{
|
|
||||||
label: '紧急',
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '重要',
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '一般',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const toggle = (value: any) => {
|
const toggle = (value: any) => {
|
||||||
|
//获取枚举 回显
|
||||||
|
getMenu();
|
||||||
//判断 是新增 还是修改
|
//判断 是新增 还是修改
|
||||||
if (value) {
|
if (value) {
|
||||||
infoObject.value = value;
|
infoObject.value = value;
|
||||||
@@ -316,6 +285,9 @@
|
|||||||
data.intervalDuration = null;
|
data.intervalDuration = null;
|
||||||
data.intervalDurationUnit = null;
|
data.intervalDurationUnit = null;
|
||||||
}
|
}
|
||||||
|
if (!data.orgId) {
|
||||||
|
data.orgId = orgId.value;
|
||||||
|
}
|
||||||
http.post(deviceAlarms.addOrUpNewData, data).then(() => {
|
http.post(deviceAlarms.addOrUpNewData, data).then(() => {
|
||||||
if (infoObject.value.id) {
|
if (infoObject.value.id) {
|
||||||
NsMessage.success('告警编辑成功');
|
NsMessage.success('告警编辑成功');
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
import { NsMessage } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
import { energyAlarms } from '/@/api/alarmManagement/alarmSettings/energyAlarm';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
const tableKeyMap = [
|
const tableKeyMap = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
@@ -155,24 +160,23 @@ export const energyAlarmConfigs = (
|
|||||||
{
|
{
|
||||||
field: 'priority',
|
field: 'priority',
|
||||||
label: '告警优先级',
|
label: '告警优先级',
|
||||||
component: 'NsSelect',
|
component: 'nsSelectApi',
|
||||||
|
// dynamicParams: {
|
||||||
|
// id: 'deviceName', //帮定上级联动数据
|
||||||
|
// },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择告警优先级',
|
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||||
|
immediate: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: [
|
resultField: 'data',
|
||||||
{
|
labelField: 'label',
|
||||||
label: '紧急',
|
valueField: 'value',
|
||||||
value: 1,
|
placeholder: '请选择告警优先级',
|
||||||
},
|
showSearch: true,
|
||||||
{
|
filterOption: (input: string, option: any) => {
|
||||||
label: '重要',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
value: 2,
|
},
|
||||||
},
|
// autoSelectFirst: true,
|
||||||
{
|
|
||||||
label: '一般',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -214,6 +218,7 @@ export const energyAlarmConfigs = (
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
params: { orgId: orgId.value },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
import { NsMessage } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
import { deviceAlarms } from '/@/api/alarmManagement/alarmSettings/deviceAlarms';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
const tableKeyMap = [
|
const tableKeyMap = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
@@ -153,24 +159,23 @@ export const equipmentAlarmTableConfig = (
|
|||||||
{
|
{
|
||||||
field: 'priority',
|
field: 'priority',
|
||||||
label: '告警优先级',
|
label: '告警优先级',
|
||||||
component: 'NsSelect',
|
component: 'nsSelectApi',
|
||||||
|
// dynamicParams: {
|
||||||
|
// id: 'deviceName', //帮定上级联动数据
|
||||||
|
// },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择告警优先级',
|
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||||
|
immediate: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: [
|
resultField: 'data',
|
||||||
{
|
labelField: 'label',
|
||||||
label: '紧急',
|
valueField: 'value',
|
||||||
value: 1,
|
placeholder: '请选择告警优先级',
|
||||||
},
|
showSearch: true,
|
||||||
{
|
filterOption: (input: string, option: any) => {
|
||||||
label: '重要',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
value: 2,
|
},
|
||||||
},
|
// autoSelectFirst: true,
|
||||||
{
|
|
||||||
label: '一般',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -212,6 +217,7 @@ export const equipmentAlarmTableConfig = (
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
params: { orgId: orgId.value },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements';
|
import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
const tableKeyMap = [
|
const tableKeyMap = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
@@ -87,24 +92,23 @@ export const notificationtableConfig = (notificationManagements: any) => {
|
|||||||
{
|
{
|
||||||
field: 'priority',
|
field: 'priority',
|
||||||
label: '告警优先级',
|
label: '告警优先级',
|
||||||
component: 'NsSelect',
|
component: 'nsSelectApi',
|
||||||
|
// dynamicParams: {
|
||||||
|
// id: 'deviceName', //帮定上级联动数据
|
||||||
|
// },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择告警优先级',
|
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||||
|
immediate: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: [
|
resultField: 'data',
|
||||||
{
|
labelField: 'label',
|
||||||
label: '紧急',
|
valueField: 'value',
|
||||||
value: 1,
|
placeholder: '请选择告警优先级',
|
||||||
},
|
showSearch: true,
|
||||||
{
|
filterOption: (input: string, option: any) => {
|
||||||
label: '重要',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
value: 2,
|
},
|
||||||
},
|
// autoSelectFirst: true,
|
||||||
{
|
|
||||||
label: '一般',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -146,6 +150,7 @@ export const notificationtableConfig = (notificationManagements: any) => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
params: { orgId: orgId.value },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
errorCode: null,
|
errorCode: null,
|
||||||
alarmTitle: null,
|
alarmTitle: null,
|
||||||
abnormalDescription: null,
|
abnormalDescription: null,
|
||||||
deviceInfo: null,
|
monitoringPoints: null,
|
||||||
alarmRepetitions: null,
|
alarmRepetitions: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
});
|
});
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
errorCode: null,
|
errorCode: null,
|
||||||
alarmTitle: null,
|
alarmTitle: null,
|
||||||
abnormalDescription: null,
|
abnormalDescription: null,
|
||||||
deviceInfo: null,
|
monitoringPoints: null,
|
||||||
alarmRepetitions: null,
|
alarmRepetitions: null,
|
||||||
updateTime: null,
|
updateTime: null,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<a-tabs>
|
<a-tabs>
|
||||||
<a-tab-pane key="1" tab="更新状态">
|
<a-tab-pane key="1" tab="更新状态">
|
||||||
<div style="width: 100%; padding: 24px">
|
<div style="width: 100%; padding: 24px">
|
||||||
<a-form ref="formRef" :model="infoObject">
|
<a-form ref="formRef" :model="infoObject" :rules="rules">
|
||||||
<a-form-item ref="state" label="当前状态" name="state">
|
<a-form-item ref="state" label="当前状态" name="state">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="infoObject.state"
|
v-model:value="infoObject.state"
|
||||||
@@ -56,6 +56,7 @@
|
|||||||
import { NsMessage } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
|
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { NsSteps },
|
components: { NsSteps },
|
||||||
@@ -67,31 +68,53 @@
|
|||||||
const energyAlarm = ref({});
|
const energyAlarm = ref({});
|
||||||
const stateOptions = ref();
|
const stateOptions = ref();
|
||||||
const logList = ref([]);
|
const logList = ref([]);
|
||||||
|
const formRef = ref();
|
||||||
const config = ref({
|
const config = ref({
|
||||||
size: logList.value.length,
|
size: logList.value.length,
|
||||||
dataSource: logList.value,
|
dataSource: logList.value,
|
||||||
});
|
});
|
||||||
|
// 表单校验
|
||||||
|
const rules = {
|
||||||
|
remarks: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入备注',
|
||||||
|
trigger: 'change',
|
||||||
|
validator: (rules, remarks, cbfn) => {
|
||||||
|
if (remarks && remarks.trim() !== '') {
|
||||||
|
cbfn();
|
||||||
|
} else {
|
||||||
|
cbfn('备注不能为空');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
state: [{ required: true, message: '请选择当前状态', trigger: 'change' }],
|
||||||
|
};
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
showEdit.value = true;
|
showEdit.value = true;
|
||||||
energyAlarm.value = {};
|
energyAlarm.value = {};
|
||||||
infoObject.value = {};
|
infoObject.value = {};
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
|
config.value.dataSource = [];
|
||||||
};
|
};
|
||||||
const btnClick = () => {
|
const btnClick = () => {
|
||||||
delete infoObject.value.createTime;
|
formRef.value.validate().then(() => {
|
||||||
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id;
|
delete infoObject.value.createTime;
|
||||||
if (energyAlarm.value.createWorkOrder === 0) {
|
infoObject.value.alarmEnergyConsumptionLogId = energyAlarm.value.id;
|
||||||
http.post(energyAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
|
if (energyAlarm.value.createWorkOrder === 0) {
|
||||||
if (res.msg === 'success') {
|
http.post(energyAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
|
||||||
NsMessage.success('操作成功');
|
if (res.msg === 'success') {
|
||||||
showEdit.value = true;
|
NsMessage.success('操作成功');
|
||||||
energyAlarm.value = {};
|
showEdit.value = true;
|
||||||
infoObject.value = {};
|
energyAlarm.value = {};
|
||||||
visible.value = false;
|
infoObject.value = {};
|
||||||
emit('logAdd', null);
|
visible.value = false;
|
||||||
}
|
emit('logAdd', null);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
//修改状态
|
//修改状态
|
||||||
const changeShowEdit = () => {
|
const changeShowEdit = () => {
|
||||||
@@ -103,23 +126,11 @@
|
|||||||
const toggle = async (data) => {
|
const toggle = async (data) => {
|
||||||
energyAlarm.value = { ...data };
|
energyAlarm.value = { ...data };
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
if (energyAlarm.value.createWorkOrder === 1) {
|
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
|
||||||
stateOptions.value = [
|
stateOptions.value = states.data;
|
||||||
{ value: 1, label: '待处理' },
|
if (energyAlarm.value.createWorkOrder !== 1) {
|
||||||
{ value: 2, label: '处理中' },
|
stateOptions.value = stateOptions.value.filter((item) => item.value !== 4);
|
||||||
{ value: 3, label: '已完成' },
|
|
||||||
{ value: 4, label: '超时' },
|
|
||||||
{ value: 5, label: '已关闭' },
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
stateOptions.value = [
|
|
||||||
{ value: 1, label: '待处理' },
|
|
||||||
{ value: 2, label: '处理中' },
|
|
||||||
{ value: 3, label: '已完成' },
|
|
||||||
{ value: 5, label: '已关闭' },
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
console.log(data, 'data');
|
|
||||||
await http
|
await http
|
||||||
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {
|
.post(energyAlarmApi.getSelectAlarmEnergyConsumptionLogStatusProcess, {
|
||||||
alarmEnergyConsumptionLogId: data.id,
|
alarmEnergyConsumptionLogId: data.id,
|
||||||
@@ -149,6 +160,8 @@
|
|||||||
infoObject,
|
infoObject,
|
||||||
changeShowEdit,
|
changeShowEdit,
|
||||||
showEdit,
|
showEdit,
|
||||||
|
rules,
|
||||||
|
formRef,
|
||||||
energyAlarm,
|
energyAlarm,
|
||||||
stateOptions,
|
stateOptions,
|
||||||
btnClick,
|
btnClick,
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
|
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
|
||||||
import { dict } from '/@/api';
|
import { dict } from '/@/api';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
const tableKeyMap = [
|
const tableKeyMap = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
@@ -20,7 +25,7 @@ const tableKeyMap = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '类型',
|
title: '类型',
|
||||||
dataIndex: 'priority',
|
dataIndex: 'dataSourcesTypeName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '优先级',
|
title: '优先级',
|
||||||
@@ -103,55 +108,45 @@ export const notificationtableConfig = (look: any, status: any) => {
|
|||||||
{
|
{
|
||||||
field: 'priority',
|
field: 'priority',
|
||||||
label: '优先级',
|
label: '优先级',
|
||||||
component: 'NsSelect',
|
component: 'nsSelectApi',
|
||||||
|
// dynamicParams: {
|
||||||
|
// id: 'deviceName', //帮定上级联动数据
|
||||||
|
// },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择告警优先级',
|
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||||
|
immediate: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: [
|
resultField: 'data',
|
||||||
{
|
labelField: 'label',
|
||||||
label: '紧急',
|
valueField: 'value',
|
||||||
value: 1,
|
placeholder: '请选择告警优先级',
|
||||||
},
|
showSearch: true,
|
||||||
{
|
filterOption: (input: string, option: any) => {
|
||||||
label: '重要',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
value: 2,
|
},
|
||||||
},
|
// autoSelectFirst: true,
|
||||||
{
|
|
||||||
label: '一般',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'alarmLogState',
|
field: 'alarmLogState',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
component: 'NsSelect',
|
component: 'nsSelectApi',
|
||||||
|
// dynamicParams: {
|
||||||
|
// id: 'deviceName', //帮定上级联动数据
|
||||||
|
// },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择状态',
|
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
|
||||||
|
immediate: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: [
|
resultField: 'data',
|
||||||
{
|
labelField: 'label',
|
||||||
label: '待处理',
|
valueField: 'value',
|
||||||
value: 1,
|
placeholder: '请选择状态',
|
||||||
},
|
showSearch: true,
|
||||||
{
|
filterOption: (input: string, option: any) => {
|
||||||
label: '处理中',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
value: 2,
|
},
|
||||||
},
|
// autoSelectFirst: true,
|
||||||
{
|
|
||||||
label: '已完成',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '超时',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '关闭',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -181,6 +176,7 @@ export const notificationtableConfig = (look: any, status: any) => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
params: { orgId: orgId.value },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,6 +56,7 @@
|
|||||||
import { NsMessage } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
import { http } from '/nerv-lib/util';
|
import { http } from '/nerv-lib/util';
|
||||||
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
|
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { NsSteps },
|
components: { NsSteps },
|
||||||
@@ -67,6 +68,7 @@
|
|||||||
const equipmentAlarm = ref({});
|
const equipmentAlarm = ref({});
|
||||||
const stateOptions = ref();
|
const stateOptions = ref();
|
||||||
const logList = ref([]);
|
const logList = ref([]);
|
||||||
|
const formRef = ref();
|
||||||
const config = ref({
|
const config = ref({
|
||||||
size: logList.value.length,
|
size: logList.value.length,
|
||||||
dataSource: logList.value,
|
dataSource: logList.value,
|
||||||
@@ -94,22 +96,26 @@
|
|||||||
equipmentAlarm.value = {};
|
equipmentAlarm.value = {};
|
||||||
infoObject.value = {};
|
infoObject.value = {};
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
|
config.value.dataSource = [];
|
||||||
|
logList.value = [];
|
||||||
};
|
};
|
||||||
const btnClick = () => {
|
const btnClick = () => {
|
||||||
delete infoObject.value.createTime;
|
formRef.value.validate().then(() => {
|
||||||
infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id;
|
delete infoObject.value.createTime;
|
||||||
if (equipmentAlarm.value.createWorkOrder === 0) {
|
infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id;
|
||||||
http.post(equipmentAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
|
if (equipmentAlarm.value.createWorkOrder === 0) {
|
||||||
if (res.msg === 'success') {
|
http.post(equipmentAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
|
||||||
NsMessage.success('操作成功');
|
if (res.msg === 'success') {
|
||||||
showEdit.value = true;
|
NsMessage.success('操作成功');
|
||||||
equipmentAlarm.value = {};
|
showEdit.value = true;
|
||||||
infoObject.value = {};
|
equipmentAlarm.value = {};
|
||||||
visible.value = false;
|
infoObject.value = {};
|
||||||
emit('logAdd', null);
|
visible.value = false;
|
||||||
}
|
emit('logAdd', null);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
//修改状态
|
//修改状态
|
||||||
const changeShowEdit = () => {
|
const changeShowEdit = () => {
|
||||||
@@ -121,23 +127,11 @@
|
|||||||
const toggle = async (data) => {
|
const toggle = async (data) => {
|
||||||
equipmentAlarm.value = { ...data };
|
equipmentAlarm.value = { ...data };
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
if (equipmentAlarm.value.createWorkOrder === 1) {
|
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
|
||||||
stateOptions.value = [
|
stateOptions.value = states.data;
|
||||||
{ value: 1, label: '待处理' },
|
if (equipmentAlarm.value.createWorkOrder !== 1) {
|
||||||
{ value: 2, label: '处理中' },
|
stateOptions.value = stateOptions.value.filter((item) => item.value !== 4);
|
||||||
{ value: 3, label: '已完成' },
|
|
||||||
{ value: 4, label: '超时' },
|
|
||||||
{ value: 5, label: '已关闭' },
|
|
||||||
];
|
|
||||||
} else {
|
|
||||||
stateOptions.value = [
|
|
||||||
{ value: 1, label: '待处理' },
|
|
||||||
{ value: 2, label: '处理中' },
|
|
||||||
{ value: 3, label: '已完成' },
|
|
||||||
{ value: 5, label: '已关闭' },
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
console.log(data, 'data');
|
|
||||||
await http
|
await http
|
||||||
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
|
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
|
||||||
alarmEquipmentLogId: data.id,
|
alarmEquipmentLogId: data.id,
|
||||||
@@ -166,6 +160,7 @@
|
|||||||
return {
|
return {
|
||||||
infoObject,
|
infoObject,
|
||||||
rules,
|
rules,
|
||||||
|
formRef,
|
||||||
changeShowEdit,
|
changeShowEdit,
|
||||||
showEdit,
|
showEdit,
|
||||||
equipmentAlarm,
|
equipmentAlarm,
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
|
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
|
|
||||||
const tableKeyMap = [
|
const tableKeyMap = [
|
||||||
{
|
{
|
||||||
@@ -20,18 +26,23 @@ const tableKeyMap = [
|
|||||||
{
|
{
|
||||||
title: '优先级',
|
title: '优先级',
|
||||||
dataIndex: 'priority',
|
dataIndex: 'priority',
|
||||||
|
width: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'alarmLogState',
|
dataIndex: 'alarmLogState',
|
||||||
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '错误码',
|
title: '错误码',
|
||||||
dataIndex: 'errorCode',
|
dataIndex: 'errorCode',
|
||||||
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '设备信息',
|
title: '设备信息',
|
||||||
dataIndex: 'deviceInfo',
|
dataIndex: 'deviceInfo',
|
||||||
|
width: 400,
|
||||||
|
// textEllipsis: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '更新时间',
|
title: '更新时间',
|
||||||
@@ -40,6 +51,7 @@ const tableKeyMap = [
|
|||||||
{
|
{
|
||||||
title: '重复次数',
|
title: '重复次数',
|
||||||
dataIndex: 'alarmRepetitions',
|
dataIndex: 'alarmRepetitions',
|
||||||
|
width: 80,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
export const notificationtableConfig = (look: any, status: any) => {
|
export const notificationtableConfig = (look: any, status: any) => {
|
||||||
@@ -77,55 +89,45 @@ export const notificationtableConfig = (look: any, status: any) => {
|
|||||||
{
|
{
|
||||||
field: 'priority',
|
field: 'priority',
|
||||||
label: '优先级',
|
label: '优先级',
|
||||||
component: 'NsSelect',
|
component: 'nsSelectApi',
|
||||||
|
// dynamicParams: {
|
||||||
|
// id: 'deviceName', //帮定上级联动数据
|
||||||
|
// },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择告警优先级',
|
api: () => getEnum({ params: { enumType: 'PriorityEnum' } }),
|
||||||
|
immediate: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: [
|
resultField: 'data',
|
||||||
{
|
labelField: 'label',
|
||||||
label: '紧急',
|
valueField: 'value',
|
||||||
value: 1,
|
placeholder: '请选择告警优先级',
|
||||||
},
|
showSearch: true,
|
||||||
{
|
filterOption: (input: string, option: any) => {
|
||||||
label: '重要',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
value: 2,
|
},
|
||||||
},
|
// autoSelectFirst: true,
|
||||||
{
|
|
||||||
label: '一般',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'alarmLogState',
|
field: 'alarmLogState',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
component: 'NsSelect',
|
component: 'nsSelectApi',
|
||||||
|
// dynamicParams: {
|
||||||
|
// id: 'deviceName', //帮定上级联动数据
|
||||||
|
// },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择状态',
|
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
|
||||||
|
immediate: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: [
|
resultField: 'data',
|
||||||
{
|
labelField: 'label',
|
||||||
label: '待处理',
|
valueField: 'value',
|
||||||
value: 1,
|
placeholder: '请选择状态',
|
||||||
},
|
showSearch: true,
|
||||||
{
|
filterOption: (input: string, option: any) => {
|
||||||
label: '处理中',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
value: 2,
|
},
|
||||||
},
|
// autoSelectFirst: true,
|
||||||
{
|
|
||||||
label: '已完成',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '超时',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '关闭',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -155,6 +157,7 @@ export const notificationtableConfig = (look: any, status: any) => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
params: { orgId: orgId.value },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import NsSteps from '/@/components/ns-steps.vue';
|
import NsSteps from '/@/components/ns-steps.vue';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { NsSteps },
|
components: { NsSteps },
|
||||||
@@ -54,19 +55,13 @@
|
|||||||
setup() {
|
setup() {
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const infoObject = ref({});
|
const infoObject = ref({});
|
||||||
const stateOptions = ref([
|
const stateOptions = ref();
|
||||||
{ value: 1, label: '待处理' },
|
|
||||||
{ value: 2, label: '处理中' },
|
|
||||||
{ value: 3, label: '已完成' },
|
|
||||||
{ value: 4, label: '超时' },
|
|
||||||
{ value: 5, label: '已关闭' },
|
|
||||||
]);
|
|
||||||
const logList = ref([
|
const logList = ref([
|
||||||
{ createName: '李四', state: 3, time: '2024-03-10 10:00:00', desc: '完成' },
|
{ realName: '李四', state: 3, createTime: '2024-03-10 10:00:00', remarks: '完成' },
|
||||||
{ createName: '王五', state: 5, time: '2024-03-10 10:00:00' },
|
{ realName: '王五', state: 5, createTime: '2024-03-10 10:00:00' },
|
||||||
{ createName: '王五', state: 4, time: '2024-03-10 10:00:00' },
|
{ realName: '王五', state: 4, createTime: '2024-03-10 10:00:00' },
|
||||||
{ createName: '王五', state: 2, time: '2024-03-10 10:00:00', desc: '创建工单' },
|
{ realName: '王五', state: 2, createTime: '2024-03-10 10:00:00', remarks: '创建工单' },
|
||||||
{ createName: '赵六', state: 1, time: '2024-03-10 10:00:00' },
|
{ realName: '赵六', state: 1, createTime: '2024-03-10 10:00:00' },
|
||||||
]);
|
]);
|
||||||
const config = ref({
|
const config = ref({
|
||||||
size: logList.value.length,
|
size: logList.value.length,
|
||||||
@@ -78,7 +73,9 @@
|
|||||||
const btnClick = () => {
|
const btnClick = () => {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
};
|
};
|
||||||
const toggle = (data) => {
|
const toggle = async (data) => {
|
||||||
|
let states = await getEnum({ params: { enumType: 'AlarmLogStateEnum' } });
|
||||||
|
stateOptions.value = states.data;
|
||||||
infoObject.value = { ...logList.value[0] };
|
infoObject.value = { ...logList.value[0] };
|
||||||
let stateMap = {
|
let stateMap = {
|
||||||
1: '待处理',
|
1: '待处理',
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm';
|
import { gatewayAlarmApi } from '/@/api/alarmManagement/gatewayAlarm';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { getEnum } from '/@/api';
|
||||||
|
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
const tableKeyMap = [
|
const tableKeyMap = [
|
||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
@@ -99,32 +105,23 @@ export const notificationtableConfig = (look: any, status: any) => {
|
|||||||
{
|
{
|
||||||
field: 'alarmLogState',
|
field: 'alarmLogState',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
component: 'NsSelect',
|
component: 'nsSelectApi',
|
||||||
|
// dynamicParams: {
|
||||||
|
// id: 'deviceName', //帮定上级联动数据
|
||||||
|
// },
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择状态',
|
api: () => getEnum({ params: { enumType: 'AlarmLogStateEnum' } }),
|
||||||
|
immediate: true,
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: [
|
resultField: 'data',
|
||||||
{
|
labelField: 'label',
|
||||||
label: '待处理',
|
valueField: 'value',
|
||||||
value: 1,
|
placeholder: '请选择状态',
|
||||||
},
|
showSearch: true,
|
||||||
{
|
filterOption: (input: string, option: any) => {
|
||||||
label: '处理中',
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
value: 2,
|
},
|
||||||
},
|
// autoSelectFirst: true,
|
||||||
{
|
|
||||||
label: '已完成',
|
|
||||||
value: 3,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '超时',
|
|
||||||
value: 4,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '关闭',
|
|
||||||
value: 5,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -139,6 +136,7 @@ export const notificationtableConfig = (look: any, status: any) => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
params: { orgId: orgId.value },
|
||||||
// pagination: { pageSizeOptions: false },
|
// pagination: { pageSizeOptions: false },
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ export const formConfig = (disabled) => {
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请输入参考文献',
|
placeholder: '请输入参考文献',
|
||||||
maxLength: 300,
|
maxLength: 300,
|
||||||
showCount:true
|
showCount: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -4,16 +4,15 @@
|
|||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<a-form style="width: 100%;margin: 0 auto;">
|
<a-form style="width: 100%; margin: 0 auto">
|
||||||
<div class="ns-form-title"><div class="title">排放分类</div></div>
|
<div class="ns-form-title"><div class="title">排放分类</div></div>
|
||||||
<div style="padding: 0 16px !important;width: 100%;">
|
<div style="padding: 0 16px !important; width: 100%">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24" style="margin-bottom: 16px;">
|
<a-col :span="24" style="margin-bottom: 16px">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="selectTreeDataValue"
|
v-model:value="selectTreeDataValue"
|
||||||
placeholder="请输入关键词"
|
placeholder="请输入关键词"
|
||||||
@search="onSearchTreeData"
|
@search="onSearchTreeData" />
|
||||||
/>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,7 +20,7 @@
|
|||||||
<a-tree
|
<a-tree
|
||||||
v-if="gData && gData.length > 0"
|
v-if="gData && gData.length > 0"
|
||||||
class="draggable-tree"
|
class="draggable-tree"
|
||||||
style="padding: 0 16px !important;"
|
style="padding: 0 16px !important"
|
||||||
draggable
|
draggable
|
||||||
show-line
|
show-line
|
||||||
checkable
|
checkable
|
||||||
@@ -39,10 +38,21 @@
|
|||||||
<template #title="data">
|
<template #title="data">
|
||||||
<div class="treeRow">
|
<div class="treeRow">
|
||||||
<div>
|
<div>
|
||||||
<span v-if="data.emissionName && selectTreeDataValue && data.emissionName.indexOf(selectTreeDataValue) > -1">
|
<span
|
||||||
{{ data.emissionName.substring(0, data.emissionName.indexOf(selectTreeDataValue)) }}
|
v-if="
|
||||||
<span style="color: #f50" >{{ selectTreeDataValue }}</span>
|
data.emissionName &&
|
||||||
{{ data.emissionName.substring(data.emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length) }}
|
selectTreeDataValue &&
|
||||||
|
data.emissionName.indexOf(selectTreeDataValue) > -1
|
||||||
|
">
|
||||||
|
{{
|
||||||
|
data.emissionName.substring(0, data.emissionName.indexOf(selectTreeDataValue))
|
||||||
|
}}
|
||||||
|
<span style="color: #f50">{{ selectTreeDataValue }}</span>
|
||||||
|
{{
|
||||||
|
data.emissionName.substring(
|
||||||
|
data.emissionName.indexOf(selectTreeDataValue) + selectTreeDataValue.length,
|
||||||
|
)
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
<span v-else>{{ data.emissionName }}</span>
|
<span v-else>{{ data.emissionName }}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -62,12 +72,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-tree>
|
</a-tree>
|
||||||
<div class="addTreeNode">
|
<div class="addTreeNode">
|
||||||
<a-button type="primary" style="width:100%;" @click="addTreeNodeData">新增</a-button>
|
<a-button type="primary" style="width: 100%" @click="addTreeNodeData">新增</a-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000}">
|
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000 }">
|
||||||
<template #bodyCell="{ record, column }">
|
<template #bodyCell="{ record, column }">
|
||||||
<template v-if="column.dataIndex === 'emissionGas'">
|
<template v-if="column.dataIndex === 'emissionGas'">
|
||||||
{{ record.emissionGas.label }}
|
{{ record.emissionGas.label }}
|
||||||
@@ -77,10 +87,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 新增树节点 -->
|
<!-- 新增树节点 -->
|
||||||
<ns-modal :visible="treeNodeAdd" :title="operationTree" @ok="handleOk" @cancel="handleCancel">
|
<ns-modal :visible="treeNodeAdd" :title="operationTree" @ok="handleOk" @cancel="handleCancel">
|
||||||
<ns-input
|
<ns-input v-model:value="addTreeNode" class="input" placeholder="请输入排放类型" />
|
||||||
v-model:value="addTreeNode"
|
|
||||||
class="input"
|
|
||||||
placeholder="请输入排放类型"/>
|
|
||||||
</ns-modal>
|
</ns-modal>
|
||||||
<!-- 新增数据库数据 -->
|
<!-- 新增数据库数据 -->
|
||||||
<a-drawer
|
<a-drawer
|
||||||
@@ -117,15 +124,21 @@
|
|||||||
<a-button type="primary" @click="addUnit">新增单位</a-button>
|
<a-button type="primary" @click="addUnit">新增单位</a-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="treePart">
|
<div class="treePart">
|
||||||
<div style="width: 100%;height: 7%;display: flex;justify-content: center;align-items: center;">
|
<div
|
||||||
|
style="
|
||||||
|
width: 100%;
|
||||||
|
height: 7%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
">
|
||||||
<a-select
|
<a-select
|
||||||
ref="select"
|
ref="select"
|
||||||
:value="unitTreeParams.id"
|
:value="unitTreeParams.id"
|
||||||
allowClear
|
allowClear
|
||||||
style="width: 96%"
|
style="width: 96%"
|
||||||
placeholder="选择分组"
|
placeholder="选择分组"
|
||||||
@change="handleChange"
|
@change="handleChange">
|
||||||
>
|
|
||||||
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id">
|
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id">
|
||||||
{{ item.cnValue }}
|
{{ item.cnValue }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@@ -146,8 +159,11 @@
|
|||||||
<div class="actionMore">
|
<div class="actionMore">
|
||||||
<EditOutlined v-if="!data.parentId" @click="editGroup(data)" />
|
<EditOutlined v-if="!data.parentId" @click="editGroup(data)" />
|
||||||
<EditOutlined v-else @click="editUnit(data)" />
|
<EditOutlined v-else @click="editUnit(data)" />
|
||||||
<MinusCircleOutlined style="margin-left: 6px;" @click="delUnit(data)" />
|
<MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" />
|
||||||
<PlusCircleOutlined v-if="!data.parentId" style="margin-left: 6px;" @click="addUnit(data)" />
|
<PlusCircleOutlined
|
||||||
|
v-if="!data.parentId"
|
||||||
|
style="margin-left: 6px"
|
||||||
|
@click="addUnit(data)" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -158,31 +174,32 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
<!-- 新增分组管理 -->
|
<!-- 新增分组管理 -->
|
||||||
<ns-modal :visible="addGroupManage" :title="addGroupTitle" @ok="unitOrGroupOk" @cancel="groupCancel">
|
<ns-modal
|
||||||
<a-form
|
:visible="addGroupManage"
|
||||||
ref="unitFormRef"
|
:title="addGroupTitle"
|
||||||
:model="formState"
|
@ok="unitOrGroupOk"
|
||||||
:label-col="labelCol"
|
@cancel="groupCancel">
|
||||||
:wrapper-col="wrapperCol"
|
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
>
|
|
||||||
<a-form-item label="分组名称" name="cnValue" :required="true">
|
<a-form-item label="分组名称" name="cnValue" :required="true">
|
||||||
<a-input v-model:value="formState.cnValue" placeholder="请输入分组名称" />
|
<a-input v-model:value="formState.cnValue" placeholder="请输入分组名称" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</ns-modal>
|
</ns-modal>
|
||||||
<!-- 新增单位 -->
|
<!-- 新增单位 -->
|
||||||
<ns-modal :visible="addUnitManage" :title="addUnitTitle" @ok="unitOrGroupOk" @cancel="unitCancel">
|
<ns-modal
|
||||||
<a-form
|
:visible="addUnitManage"
|
||||||
ref="unitFormRef"
|
:title="addUnitTitle"
|
||||||
:model="formState"
|
@ok="unitOrGroupOk"
|
||||||
:label-col="labelCol"
|
@cancel="unitCancel">
|
||||||
:wrapper-col="wrapperCol"
|
<a-form ref="unitFormRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
>
|
|
||||||
<a-form-item label="单位名称" name="cnValue" :required="true">
|
<a-form-item label="单位名称" name="cnValue" :required="true">
|
||||||
<a-input v-model:value="formState.cnValue" placeholder="请输入单位名称" />
|
<a-input v-model:value="formState.cnValue" placeholder="请输入单位名称" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="选择分组" name="parentId" :required="true">
|
<a-form-item label="选择分组" name="parentId" :required="true">
|
||||||
<a-select v-model:value="formState.parentId" placeholder="请选择所属分组" :disabled="canSelect">
|
<a-select
|
||||||
|
v-model:value="formState.parentId"
|
||||||
|
placeholder="请选择所属分组"
|
||||||
|
:disabled="canSelect">
|
||||||
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id">
|
<a-select-option v-for="(item, index) in groupData" :key="index" :value="item.id">
|
||||||
{{ item.cnValue }}
|
{{ item.cnValue }}
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
@@ -193,12 +210,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { MoreOutlined,ExclamationCircleOutlined,EditOutlined,PlusCircleOutlined,MinusCircleOutlined } from '@ant-design/icons-vue';
|
import {
|
||||||
|
ExclamationCircleOutlined,
|
||||||
|
EditOutlined,
|
||||||
|
PlusCircleOutlined,
|
||||||
|
MinusCircleOutlined,
|
||||||
|
} from '@ant-design/icons-vue';
|
||||||
import { Modal } from 'ant-design-vue';
|
import { Modal } from 'ant-design-vue';
|
||||||
import { computed, createVNode, defineComponent, reactive, ref, watchEffect,watch,toRaw } from 'vue';
|
import { computed, createVNode, reactive, ref, watchEffect, watch, toRaw } from 'vue';
|
||||||
import { http } from '/nerv-lib/util/http';
|
import { http } from '/nerv-lib/util/http';
|
||||||
import { NsMessage, NsModal } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
import { formConfig, formConfig2 } from './config';
|
import { formConfig } from './config';
|
||||||
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
||||||
import type {
|
import type {
|
||||||
AntTreeNodeDragEnterEvent,
|
AntTreeNodeDragEnterEvent,
|
||||||
@@ -208,10 +230,21 @@
|
|||||||
import { log } from 'node:console';
|
import { log } from 'node:console';
|
||||||
|
|
||||||
defineOptions({ name: 'OrderListIndex' });
|
defineOptions({ name: 'OrderListIndex' });
|
||||||
|
const orgId = ref('');
|
||||||
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
|
orgId.value = result;
|
||||||
|
const dynamicDisabled = computed(() => {
|
||||||
|
return formRef.value?.validateResult && userAuthList.value?.length;
|
||||||
|
});
|
||||||
|
const fetch = (api, params = { orgId }) => {
|
||||||
|
return http.post(api, params);
|
||||||
|
};
|
||||||
const selectTreeDataValue = ref<string>('');
|
const selectTreeDataValue = ref<string>('');
|
||||||
const mainRef = ref();
|
const mainRef = ref();
|
||||||
const data = reactive({});
|
const data = reactive({});
|
||||||
let formData = ref({});
|
let formData = ref({
|
||||||
|
orgId: orgId.value,
|
||||||
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const unitManagement = ref(false);
|
const unitManagement = ref(false);
|
||||||
@@ -220,7 +253,7 @@
|
|||||||
const disabled = ref(false);
|
const disabled = ref(false);
|
||||||
const treeNodeAdd = ref<boolean>(false);
|
const treeNodeAdd = ref<boolean>(false);
|
||||||
const operationTree = ref<string>('新增');
|
const operationTree = ref<string>('新增');
|
||||||
const showOperation = ref(false)
|
const showOperation = ref(false);
|
||||||
|
|
||||||
const opMap: any = ref({
|
const opMap: any = ref({
|
||||||
type: 'add',
|
type: 'add',
|
||||||
@@ -234,15 +267,6 @@
|
|||||||
const casData = ref([]);
|
const casData = ref([]);
|
||||||
const treeData = ref([]);
|
const treeData = ref([]);
|
||||||
const userAuthList = ref([]);
|
const userAuthList = ref([]);
|
||||||
const orgId = ref('');
|
|
||||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
|
||||||
orgId.value = result;
|
|
||||||
const dynamicDisabled = computed(() => {
|
|
||||||
return formRef.value?.validateResult && userAuthList.value?.length;
|
|
||||||
});
|
|
||||||
const fetch = (api, params = { orgId }) => {
|
|
||||||
return http.post(api, params);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 树结构
|
// 树结构
|
||||||
const x = 3;
|
const x = 3;
|
||||||
@@ -358,7 +382,7 @@
|
|||||||
for (let i = 0; i < tree.length; i++) {
|
for (let i = 0; i < tree.length; i++) {
|
||||||
const node = tree[i];
|
const node = tree[i];
|
||||||
if (node.children) {
|
if (node.children) {
|
||||||
if (node.children.some(item => item.key === key)) {
|
if (node.children.some((item) => item.key === key)) {
|
||||||
parentKey = node.key;
|
parentKey = node.key;
|
||||||
} else if (getParentKey(key, node.children)) {
|
} else if (getParentKey(key, node.children)) {
|
||||||
parentKey = getParentKey(key, node.children);
|
parentKey = getParentKey(key, node.children);
|
||||||
@@ -374,7 +398,7 @@
|
|||||||
expandedKeys.value = keys;
|
expandedKeys.value = keys;
|
||||||
autoExpandParent.value = false;
|
autoExpandParent.value = false;
|
||||||
};
|
};
|
||||||
watch(selectTreeDataValue, value => {
|
watch(selectTreeDataValue, (value) => {
|
||||||
const expanded = dataList
|
const expanded = dataList
|
||||||
.map((item: TreeProps['treeData'][number]) => {
|
.map((item: TreeProps['treeData'][number]) => {
|
||||||
if (item.title.indexOf(value) > -1) {
|
if (item.title.indexOf(value) > -1) {
|
||||||
@@ -393,70 +417,70 @@
|
|||||||
console.log('or use this.value', value.value);
|
console.log('or use this.value', value.value);
|
||||||
};
|
};
|
||||||
// 点击数据点的复选框
|
// 点击数据点的复选框
|
||||||
const checkedIds = ref([])
|
const checkedIds = ref([]);
|
||||||
const emissionType = ref()
|
const emissionType = ref();
|
||||||
const checkTreeNode = (checkedKeys, info) => {
|
const checkTreeNode = (checkedKeys, info) => {
|
||||||
checkedTreeNodeKeys.value = checkedKeys
|
checkedTreeNodeKeys.value = checkedKeys;
|
||||||
checkedIds.value = []
|
checkedIds.value = [];
|
||||||
info.checkedNodes.forEach(item=>{
|
info.checkedNodes.forEach((item) => {
|
||||||
checkedIds.value.push(item.id)
|
checkedIds.value.push(item.id);
|
||||||
})
|
});
|
||||||
sessionStorage.setItem('checkedTreeNode', checkedIds.value);
|
sessionStorage.setItem('checkedTreeNode', checkedIds.value);
|
||||||
emissionType.value = checkedIds.value.join(',')
|
emissionType.value = checkedIds.value.join(',');
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
}
|
};
|
||||||
// 点击新增树节点
|
// 点击新增树节点
|
||||||
const addTreeNodeData = () => {
|
const addTreeNodeData = () => {
|
||||||
operationTree.value='新增'
|
operationTree.value = '新增';
|
||||||
treeNodeAdd.value = true;
|
treeNodeAdd.value = true;
|
||||||
editTreeNode.value.type = 'create'
|
editTreeNode.value.type = 'create';
|
||||||
};
|
};
|
||||||
// 编辑树节点
|
// 编辑树节点
|
||||||
const editTreeNodeData = (data) => {
|
const editTreeNodeData = (data) => {
|
||||||
operationTree.value='编辑'
|
operationTree.value = '编辑';
|
||||||
treeNodeAdd.value = true;
|
treeNodeAdd.value = true;
|
||||||
editTreeNode.value.type = 'update'
|
editTreeNode.value.type = 'update';
|
||||||
addTreeNode.value = data.emissionName
|
addTreeNode.value = data.emissionName;
|
||||||
}
|
};
|
||||||
// 删除树节点
|
// 删除树节点
|
||||||
const deleteTreeNode = () => {
|
const deleteTreeNode = () => {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '警告',
|
title: '警告',
|
||||||
icon: createVNode(ExclamationCircleOutlined),
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
content: '确定要删除么?',
|
content: '确定要删除么?',
|
||||||
okText: '确认',
|
okText: '确认',
|
||||||
okType: 'primary',
|
okType: 'primary',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk() {
|
onOk() {
|
||||||
http.post(carbonEmissionFactorLibrary.delTreeNode,editTreeNode.value).then(() => {
|
http.post(carbonEmissionFactorLibrary.delTreeNode, editTreeNode.value).then(() => {
|
||||||
getOrgTree()
|
getOrgTree();
|
||||||
NsMessage.success('操作成功');
|
NsMessage.success('操作成功');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
console.log('Cancel');
|
console.log('Cancel');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
// 新增/编辑树节点点击确定
|
// 新增/编辑树节点点击确定
|
||||||
const addTreeNode =ref()
|
const addTreeNode = ref();
|
||||||
const handleOk = (e: MouseEvent) => {
|
const handleOk = (e: MouseEvent) => {
|
||||||
editTreeNode.value.emissionName = addTreeNode.value
|
editTreeNode.value.emissionName = addTreeNode.value;
|
||||||
http.post(carbonEmissionFactorLibrary.creat,editTreeNode.value).then(() => {
|
http.post(carbonEmissionFactorLibrary.creat, editTreeNode.value).then(() => {
|
||||||
getOrgTree()
|
getOrgTree();
|
||||||
NsMessage.success('操作成功');
|
NsMessage.success('操作成功');
|
||||||
addTreeNode.value = ''
|
addTreeNode.value = '';
|
||||||
treeNodeAdd.value = false;
|
treeNodeAdd.value = false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
addTreeNode.value = ''
|
addTreeNode.value = '';
|
||||||
treeNodeAdd.value = false;
|
treeNodeAdd.value = false;
|
||||||
};
|
};
|
||||||
// 获取排放分类树
|
// 获取排放分类树
|
||||||
const getOrgTree = (params?) => {
|
const getOrgTree = () => {
|
||||||
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, params).then((res) => {
|
fetch(carbonEmissionFactorLibrary.getCarbonFactorTree, { orgId: orgId.value }).then((res) => {
|
||||||
gData.value = res.data
|
gData.value = res.data;
|
||||||
// 找到匹配的节点数据
|
// 找到匹配的节点数据
|
||||||
// const selectedNodes = [];
|
// const selectedNodes = [];
|
||||||
// checkedTreeNodeKeys.value.forEach(key => {
|
// checkedTreeNodeKeys.value.forEach(key => {
|
||||||
@@ -469,31 +493,31 @@
|
|||||||
// getDefaultIds(selectedNodes)
|
// getDefaultIds(selectedNodes)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const defaultIds = ref([])
|
const defaultIds = ref([]);
|
||||||
const getDefaultIds = (selectedNodes) => {
|
const getDefaultIds = (selectedNodes) => {
|
||||||
selectedNodes.forEach(items => {
|
selectedNodes.forEach((items) => {
|
||||||
defaultIds.value.push(items.id)
|
defaultIds.value.push(items.id);
|
||||||
if(items.children){
|
if (items.children) {
|
||||||
getDefaultIds(items.children)
|
getDefaultIds(items.children);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
emissionType.value = defaultIds.value.join(',')
|
emissionType.value = defaultIds.value.join(',');
|
||||||
checkedIds.value = defaultIds.value
|
checkedIds.value = defaultIds.value;
|
||||||
sessionStorage.setItem('checkedTreeNode', checkedIds.value);
|
sessionStorage.setItem('checkedTreeNode', checkedIds.value);
|
||||||
}
|
};
|
||||||
getOrgTree();
|
getOrgTree();
|
||||||
// 被选中的树节点
|
// 被选中的树节点
|
||||||
const editTreeNode = ref({})
|
const editTreeNode = ref({});
|
||||||
const onSelect = (selectedKeys: string[], info: any) => {
|
const onSelect = (selectedKeys: string[], info: any) => {
|
||||||
if(info.selected){
|
if (info.selected) {
|
||||||
showOperation.value = true
|
showOperation.value = true;
|
||||||
editTreeNode.value = {
|
editTreeNode.value = {
|
||||||
id:info.selectedNodes[0].id,
|
id: info.selectedNodes[0].id,
|
||||||
level:info.selectedNodes[0].level,
|
level: info.selectedNodes[0].level,
|
||||||
dataNumber:info.selectedNodes[0].dataNumber,
|
dataNumber: info.selectedNodes[0].dataNumber,
|
||||||
sortNumber:info.selectedNodes[0].sortNumber,
|
sortNumber: info.selectedNodes[0].sortNumber,
|
||||||
parentEmissionId:info.selectedNodes[0].parentEmissionId,
|
parentEmissionId: info.selectedNodes[0].parentEmissionId,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -516,13 +540,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSelect = (selectedKeys: any, info: any) => {
|
const handleSelect = (selectedKeys: any, info: any) => {
|
||||||
fetch(carbonEmissionFactorLibrary.queryDeptTree, { orgId: info.node?.orgInfo.orgId }).then((res) => {
|
fetch(carbonEmissionFactorLibrary.queryDeptTree, { orgId: info.node?.orgInfo.orgId }).then(
|
||||||
treeData2.value = res.data;
|
(res) => {
|
||||||
});
|
treeData2.value = res.data;
|
||||||
|
},
|
||||||
|
);
|
||||||
tableFetch({ orgId: info.node?.orgInfo.orgId });
|
tableFetch({ orgId: info.node?.orgInfo.orgId });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
formData.value = {};
|
formData.value = {};
|
||||||
@@ -530,8 +555,8 @@
|
|||||||
};
|
};
|
||||||
const closeUnitManag = () => {
|
const closeUnitManag = () => {
|
||||||
unitTreeParams.value = {
|
unitTreeParams.value = {
|
||||||
grp: 'MEASUREMENT_UNIT'
|
grp: 'MEASUREMENT_UNIT',
|
||||||
}
|
};
|
||||||
unitManagement.value = false;
|
unitManagement.value = false;
|
||||||
};
|
};
|
||||||
const onEdit = () => {
|
const onEdit = () => {
|
||||||
@@ -542,8 +567,7 @@
|
|||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
opMap.value.fuc &&
|
opMap.value.fuc && opMap.value.fuc({ ...formData.value });
|
||||||
opMap.value.fuc({ ...formData.value });
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
@@ -551,7 +575,7 @@
|
|||||||
api: carbonEmissionFactorLibrary.getTableList,
|
api: carbonEmissionFactorLibrary.getTableList,
|
||||||
params: {
|
params: {
|
||||||
orgId,
|
orgId,
|
||||||
emissionType
|
emissionType,
|
||||||
},
|
},
|
||||||
headerActions: [
|
headerActions: [
|
||||||
{
|
{
|
||||||
@@ -562,13 +586,13 @@
|
|||||||
opMap.value.type = 'add';
|
opMap.value.type = 'add';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
carbonEmissionPrefix:'t',
|
carbonEmissionPrefix: 't',
|
||||||
numberOfReferences:'10'
|
numberOfReferences: '10',
|
||||||
};
|
};
|
||||||
userAuthList.value.splice(0);
|
userAuthList.value.splice(0);
|
||||||
});
|
});
|
||||||
opMap.value.fuc = (formData: any) => {
|
opMap.value.fuc = (formData: any) => {
|
||||||
formData.emissionType = formData.emissionType[formData.emissionType.length - 1]
|
formData.emissionType = formData.emissionType[formData.emissionType.length - 1];
|
||||||
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => {
|
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => {
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
@@ -607,11 +631,13 @@
|
|||||||
type: 'primary',
|
type: 'primary',
|
||||||
name: 'userAdd',
|
name: 'userAdd',
|
||||||
handle: () => {
|
handle: () => {
|
||||||
unitManagement.value = true,
|
(unitManagement.value = true),
|
||||||
fetch(carbonEmissionFactorLibrary.findOutermost,{grp:'MEASUREMENT_UNIT'}).then((res) => {
|
fetch(carbonEmissionFactorLibrary.findOutermost, { grp: 'MEASUREMENT_UNIT' }).then(
|
||||||
groupData.value = res.data
|
(res) => {
|
||||||
});
|
groupData.value = res.data;
|
||||||
getUnitTree()
|
},
|
||||||
|
);
|
||||||
|
getUnitTree();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -672,14 +698,14 @@
|
|||||||
handle: (record: any) => {
|
handle: (record: any) => {
|
||||||
userAuthList.value.splice(0);
|
userAuthList.value.splice(0);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const measurementUnit = ref([])
|
const measurementUnit = ref([]);
|
||||||
http.post(carbonEmissionFactorLibrary.getCarbonFactorTree,{}).then((res) => {
|
http.post(carbonEmissionFactorLibrary.getCarbonFactorTree, {}).then((res) => {
|
||||||
measurementUnit.value = res.data
|
measurementUnit.value = res.data;
|
||||||
http.post(carbonEmissionFactorLibrary.findById,{ id: record.id } ).then((res) => {
|
http.post(carbonEmissionFactorLibrary.findById, { id: record.id }).then((res) => {
|
||||||
if (res.data.emissionType) {
|
if (res.data.emissionType) {
|
||||||
let selectDevice = ref([Number(res.data.emissionType)]);
|
let selectDevice = ref([Number(res.data.emissionType)]);
|
||||||
findParentIds(measurementUnit.value, res.data.emissionType, selectDevice.value);
|
findParentIds(measurementUnit.value, res.data.emissionType, selectDevice.value);
|
||||||
res.data.emissionType = selectDevice
|
res.data.emissionType = selectDevice;
|
||||||
}
|
}
|
||||||
formData.value = res.data;
|
formData.value = res.data;
|
||||||
});
|
});
|
||||||
@@ -687,9 +713,9 @@
|
|||||||
}, 10);
|
}, 10);
|
||||||
opMap.value.type = 'edit';
|
opMap.value.type = 'edit';
|
||||||
opMap.value.fuc = (formData: any) => {
|
opMap.value.fuc = (formData: any) => {
|
||||||
formData.emissionType = formData.emissionType[formData.emissionType.length - 1]
|
formData.emissionType = formData.emissionType[formData.emissionType.length - 1];
|
||||||
if(formData.emissionGas.value){
|
if (formData.emissionGas.value) {
|
||||||
formData.emissionGas = formData.emissionGas.value
|
formData.emissionGas = formData.emissionGas.value;
|
||||||
}
|
}
|
||||||
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => {
|
return http.post(carbonEmissionFactorLibrary.creatOrUpdate, formData).then(() => {
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
@@ -756,7 +782,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'SF6',
|
label: 'SF6',
|
||||||
value:3,
|
value: 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'CH4',
|
label: 'CH4',
|
||||||
@@ -815,9 +841,9 @@
|
|||||||
result.unshift(item.id); // 将当前节点的id添加到结果数组的最前面
|
result.unshift(item.id); // 将当前节点的id添加到结果数组的最前面
|
||||||
findParentIds(tree, item.id, result); // 递归查找父级节点的id
|
findParentIds(tree, item.id, result); // 递归查找父级节点的id
|
||||||
break; // 找到后可以退出循环
|
break; // 找到后可以退出循环
|
||||||
}else{
|
} else {
|
||||||
for(let childsItem of item.children){
|
for (let childsItem of item.children) {
|
||||||
if(childsItem.children && childsItem.children.length > 0){
|
if (childsItem.children && childsItem.children.length > 0) {
|
||||||
if (childsItem.children.some((child: any) => child.id === Number(targetId))) {
|
if (childsItem.children.some((child: any) => child.id === Number(targetId))) {
|
||||||
result.unshift(childsItem.id); // 将当前节点的id添加到结果数组的最前面
|
result.unshift(childsItem.id); // 将当前节点的id添加到结果数组的最前面
|
||||||
findParentIds(tree, childsItem.id, result); // 递归查找父级节点的id
|
findParentIds(tree, childsItem.id, result); // 递归查找父级节点的id
|
||||||
@@ -829,24 +855,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 单位管理
|
// 单位管理
|
||||||
const unitExpandedKeys = ref<string[]>();
|
const unitExpandedKeys = ref<string[]>();
|
||||||
const unitSelectedKeys = ref<string[]>([]);
|
const unitSelectedKeys = ref<string[]>([]);
|
||||||
const unitTreeParams = ref({
|
const unitTreeParams = ref({
|
||||||
grp: 'MEASUREMENT_UNIT'
|
grp: 'MEASUREMENT_UNIT',
|
||||||
})
|
});
|
||||||
const groupData = ref([])
|
const groupData = ref([]);
|
||||||
const unitTreeData = ref<TreeProps['treeData']>(genData);
|
const unitTreeData = ref<TreeProps['treeData']>(genData);
|
||||||
const handleChange = (value: string) => {
|
const handleChange = (value: string) => {
|
||||||
unitTreeParams.value.id = value
|
unitTreeParams.value.id = value;
|
||||||
getUnitTree()
|
getUnitTree();
|
||||||
};
|
};
|
||||||
const getUnitTree = () => {
|
const getUnitTree = () => {
|
||||||
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, unitTreeParams.value).then((res) => {
|
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, unitTreeParams.value).then(
|
||||||
unitTreeData.value = res.data
|
(res) => {
|
||||||
});
|
unitTreeData.value = res.data;
|
||||||
}
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
// 新增单位管理
|
// 新增单位管理
|
||||||
const labelCol = { span: 5 };
|
const labelCol = { span: 5 };
|
||||||
const wrapperCol = { span: 19 };
|
const wrapperCol = { span: 19 };
|
||||||
@@ -857,100 +885,100 @@
|
|||||||
const formState = ref({
|
const formState = ref({
|
||||||
grp: 'MEASUREMENT_UNIT',
|
grp: 'MEASUREMENT_UNIT',
|
||||||
grpDesc: '计量单位',
|
grpDesc: '计量单位',
|
||||||
})
|
});
|
||||||
const addGroupTitle = ref<string>('新增分组');
|
const addGroupTitle = ref<string>('新增分组');
|
||||||
const addUnitTitle = ref<string>('新增单位');
|
const addUnitTitle = ref<string>('新增单位');
|
||||||
const addGroup = () => {
|
const addGroup = () => {
|
||||||
addGroupTitle.value = '新增分组'
|
addGroupTitle.value = '新增分组';
|
||||||
addGroupManage.value = true
|
addGroupManage.value = true;
|
||||||
};
|
};
|
||||||
const editGroup = (data) => {
|
const editGroup = (data) => {
|
||||||
addGroupTitle.value = '编辑分组'
|
addGroupTitle.value = '编辑分组';
|
||||||
addGroupManage.value = true
|
addGroupManage.value = true;
|
||||||
formState.value.id = data.id
|
formState.value.id = data.id;
|
||||||
formState.value.cnValue = data.cnValue
|
formState.value.cnValue = data.cnValue;
|
||||||
};
|
};
|
||||||
const groupCancel = () => {
|
const groupCancel = () => {
|
||||||
addGroupManage.value = false
|
addGroupManage.value = false;
|
||||||
unitFormRef.value.resetFields();
|
unitFormRef.value.resetFields();
|
||||||
formState.value = {
|
formState.value = {
|
||||||
grp: 'MEASUREMENT_UNIT',
|
grp: 'MEASUREMENT_UNIT',
|
||||||
grpDesc: '计量单位',
|
grpDesc: '计量单位',
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
const addUnit = (data) => {
|
const addUnit = (data) => {
|
||||||
if(data.id){
|
if (data.id) {
|
||||||
canSelect.value = true
|
canSelect.value = true;
|
||||||
formState.value.parentId = data.id
|
formState.value.parentId = data.id;
|
||||||
}else{
|
} else {
|
||||||
canSelect.value = false
|
canSelect.value = false;
|
||||||
}
|
}
|
||||||
fetch(carbonEmissionFactorLibrary.findOutermost).then((res) => {
|
fetch(carbonEmissionFactorLibrary.findOutermost).then((res) => {
|
||||||
groupData.value = res.data
|
groupData.value = res.data;
|
||||||
});
|
});
|
||||||
addUnitTitle.value = '新增单位'
|
addUnitTitle.value = '新增单位';
|
||||||
addUnitManage.value = true
|
addUnitManage.value = true;
|
||||||
};
|
};
|
||||||
const editUnit = (data) => {
|
const editUnit = (data) => {
|
||||||
addUnitTitle.value = '编辑单位'
|
addUnitTitle.value = '编辑单位';
|
||||||
addUnitManage.value = true
|
addUnitManage.value = true;
|
||||||
canSelect.value = true
|
canSelect.value = true;
|
||||||
formState.value.parentId = data.parentId
|
formState.value.parentId = data.parentId;
|
||||||
formState.value.id = data.id
|
formState.value.id = data.id;
|
||||||
formState.value.cnValue = data.cnValue
|
formState.value.cnValue = data.cnValue;
|
||||||
};
|
};
|
||||||
const unitCancel = () => {
|
const unitCancel = () => {
|
||||||
addUnitManage.value = false
|
addUnitManage.value = false;
|
||||||
unitFormRef.value.resetFields();
|
unitFormRef.value.resetFields();
|
||||||
formState.value = {
|
formState.value = {
|
||||||
grp: 'MEASUREMENT_UNIT',
|
grp: 'MEASUREMENT_UNIT',
|
||||||
grpDesc: '计量单位',
|
grpDesc: '计量单位',
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
const unitOrGroupOk = () => {
|
const unitOrGroupOk = () => {
|
||||||
unitFormRef.value
|
unitFormRef.value
|
||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('values', formState, toRaw(formState));
|
console.log('values', formState, toRaw(formState));
|
||||||
if(formState.value.id){
|
if (formState.value.id) {
|
||||||
fetch(carbonEmissionFactorLibrary.updateDictionary, formState.value).then((res) => {
|
fetch(carbonEmissionFactorLibrary.updateDictionary, formState.value).then((res) => {
|
||||||
unitTreeData.value = res.data
|
unitTreeData.value = res.data;
|
||||||
if(formState.value.parentId){
|
if (formState.value.parentId) {
|
||||||
addUnitManage.value = false
|
addUnitManage.value = false;
|
||||||
}else{
|
} else {
|
||||||
addGroupManage.value = false
|
addGroupManage.value = false;
|
||||||
}
|
}
|
||||||
unitFormRef.value.resetFields();
|
unitFormRef.value.resetFields();
|
||||||
formState.value = {
|
formState.value = {
|
||||||
grp: 'MEASUREMENT_UNIT',
|
grp: 'MEASUREMENT_UNIT',
|
||||||
grpDesc: '计量单位',
|
grpDesc: '计量单位',
|
||||||
}
|
};
|
||||||
getUnitTree()
|
getUnitTree();
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
fetch(carbonEmissionFactorLibrary.createDictionary, formState.value).then((res) => {
|
fetch(carbonEmissionFactorLibrary.createDictionary, formState.value).then((res) => {
|
||||||
unitTreeData.value = res.data
|
unitTreeData.value = res.data;
|
||||||
if(formState.value.parentId){
|
if (formState.value.parentId) {
|
||||||
addUnitManage.value = false
|
addUnitManage.value = false;
|
||||||
}else{
|
} else {
|
||||||
addGroupManage.value = false
|
addGroupManage.value = false;
|
||||||
}
|
}
|
||||||
unitFormRef.value.resetFields();
|
unitFormRef.value.resetFields();
|
||||||
formState.value = {
|
formState.value = {
|
||||||
grp: 'MEASUREMENT_UNIT',
|
grp: 'MEASUREMENT_UNIT',
|
||||||
grpDesc: '计量单位',
|
grpDesc: '计量单位',
|
||||||
}
|
};
|
||||||
getUnitTree()
|
getUnitTree();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 删除单位管理的树节点
|
// 删除单位管理的树节点
|
||||||
const delUnit = (data) => {
|
const delUnit = (data) => {
|
||||||
formState.value.id = data.id
|
formState.value.id = data.id;
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: '警告',
|
title: '警告',
|
||||||
content: '确定要删除吗?',
|
content: '确定要删除吗?',
|
||||||
@@ -958,9 +986,9 @@
|
|||||||
okType: 'primary',
|
okType: 'primary',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk() {
|
onOk() {
|
||||||
fetch(carbonEmissionFactorLibrary.delDictionary , formState.value).then((res) => {
|
fetch(carbonEmissionFactorLibrary.delDictionary, formState.value).then((res) => {
|
||||||
message.success('操作成功!');
|
message.success('操作成功!');
|
||||||
getUnitTree()
|
getUnitTree();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
@@ -968,7 +996,6 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.main {
|
.main {
|
||||||
@@ -988,9 +1015,9 @@
|
|||||||
}
|
}
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.top{
|
.top {
|
||||||
position: relative;
|
position: relative;
|
||||||
.addTreeNode{
|
.addTreeNode {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -1008,7 +1035,7 @@
|
|||||||
// border-bottom: 5px solid rgb(229, 235, 240);
|
// border-bottom: 5px solid rgb(229, 235, 240);
|
||||||
// overflow-y: auto;
|
// overflow-y: auto;
|
||||||
}
|
}
|
||||||
.ns-form-title{
|
.ns-form-title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
user-select: text;
|
user-select: text;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -1016,7 +1043,7 @@
|
|||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
border-bottom: 1px solid #e9e9e9;
|
border-bottom: 1px solid #e9e9e9;
|
||||||
}
|
}
|
||||||
.title{
|
.title {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
@@ -1034,21 +1061,21 @@
|
|||||||
height: 13px;
|
height: 13px;
|
||||||
width: 3px;
|
width: 3px;
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
background-color: #2778FF;
|
background-color: #2778ff;
|
||||||
}
|
}
|
||||||
.treeRow {
|
.treeRow {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.addButton{
|
.addButton {
|
||||||
width: 70%;
|
width: 70%;
|
||||||
height: 5vh;
|
height: 5vh;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
}
|
}
|
||||||
.treePart{
|
.treePart {
|
||||||
width: 70%;
|
width: 70%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -1,20 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-table
|
<a-table
|
||||||
:columns="column"
|
:columns="column"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
bordered
|
bordered
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
:scroll="{ x: 2000,y:480 }">
|
:scroll="{ x: 2000, y: 480 }">
|
||||||
<template #title>
|
<template #title>
|
||||||
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" valueFormat="YYYY" />
|
<a-date-picker
|
||||||
|
v-model:value="selectYear"
|
||||||
|
picker="year"
|
||||||
|
@change="changeYearData"
|
||||||
|
valueFormat="YYYY" />
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
<a-pagination
|
<a-pagination
|
||||||
:current="queryParams.pageNum"
|
:current="queryParams.pageNum"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page-size="queryParams.pageSize"
|
:page-size="queryParams.pageSize"
|
||||||
style="display: flex;justify-content: center;margin-top: 16px;"
|
style="display: flex; justify-content: center; margin-top: 16px"
|
||||||
:show-size-changer="true"
|
:show-size-changer="true"
|
||||||
:show-quick-jumper="true"
|
:show-quick-jumper="true"
|
||||||
@change="onChange" />
|
@change="onChange" />
|
||||||
@@ -35,26 +39,26 @@
|
|||||||
const orgId = ref('');
|
const orgId = ref('');
|
||||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
orgId.value = result;
|
orgId.value = result;
|
||||||
const fetch = (api, params = { orgId } ) => {
|
const fetch = (api, params = { orgId }) => {
|
||||||
return http.post(api, params);
|
return http.post(api, params);
|
||||||
};
|
};
|
||||||
const data = ref([]);
|
const data = ref([]);
|
||||||
const selectYear = ref<Dayjs>(dayjs( new Date().getFullYear().toString()));
|
const selectYear = ref<Dayjs>(dayjs(new Date().getFullYear().toString()));
|
||||||
const total = ref<number>()
|
const total = ref<number>();
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
year: selectYear.value.format('YYYY'),
|
year: selectYear.value.format('YYYY'),
|
||||||
orgId: orgId.value
|
orgId: orgId.value,
|
||||||
})
|
});
|
||||||
|
|
||||||
// 年份选择改变触发
|
// 年份选择改变触发
|
||||||
const changeYearData = () => {
|
const changeYearData = () => {
|
||||||
queryParams.value.year = selectYear.value
|
queryParams.value.year = selectYear.value;
|
||||||
getTableList()
|
getTableList();
|
||||||
}
|
};
|
||||||
// 表头
|
// 表头
|
||||||
const column: TableColumnsType [] = [
|
const column: TableColumnsType[] = [
|
||||||
{
|
{
|
||||||
title: '排放类型',
|
title: '排放类型',
|
||||||
dataIndex: 'cnValue',
|
dataIndex: 'cnValue',
|
||||||
@@ -163,24 +167,24 @@
|
|||||||
};
|
};
|
||||||
// 获取表格数据
|
// 获取表格数据
|
||||||
const getTableList = () => {
|
const getTableList = () => {
|
||||||
fetch(carbonEmission.carbonEmissionStatistics , queryParams.value).then((res) => {
|
fetch(carbonEmission.carbonEmissionStatistics, queryParams.value).then((res) => {
|
||||||
data.value = res.data
|
data.value = res.data;
|
||||||
total.value = res.data.length
|
total.value = res.data.length;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
getTableList()
|
getTableList();
|
||||||
// 分页器
|
// 分页器
|
||||||
const onChange = (pageNumber: number,size: number) => {
|
const onChange = (pageNumber: number, size: number) => {
|
||||||
queryParams.value.pageNum = pageNumber;
|
queryParams.value.pageNum = pageNumber;
|
||||||
queryParams.value.pageSize = size;
|
queryParams.value.pageSize = size;
|
||||||
getTableList()
|
getTableList();
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
:deep(.ant-table-title){
|
:deep(.ant-table-title) {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
:deep(.ant-table-container){
|
:deep(.ant-table-container) {
|
||||||
padding: 0px 16px;
|
padding: 0px 16px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -189,4 +193,4 @@
|
|||||||
td.column-money {
|
td.column-money {
|
||||||
text-align: right !important;
|
text-align: right !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -165,19 +165,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref,reactive, toRaw } from 'vue';
|
import { ref, toRaw } from 'vue';
|
||||||
import type { UnwrapRef } from 'vue';
|
|
||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
import { Pagination,message,Modal } from 'ant-design-vue';
|
import { Pagination,message,Modal } from 'ant-design-vue';
|
||||||
import { InboxOutlined } from '@ant-design/icons-vue';
|
import type { TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
|
||||||
import type { CascaderProps,TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
|
|
||||||
import { NsMessage } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
import { http } from '/nerv-lib/util/http';
|
import { http } from '/nerv-lib/util/http';
|
||||||
import { tableColumns } from '../config';
|
import { tableColumns } from '../config';
|
||||||
import { energyConsumption,carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
import { energyConsumption,carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
||||||
import { group } from '/@/api/deviceManage';
|
import { group } from '/@/api/deviceManage';
|
||||||
import { dict } from '/@/api';
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
energyType: 'EnergyConsumption', // 与页面路由name一致缓存才可生效
|
energyType: 'EnergyConsumption', // 与页面路由name一致缓存才可生效
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -31,4 +31,3 @@
|
|||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,15 @@
|
|||||||
<div class="main">
|
<div class="main">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<a-form style="width: 100%;margin: 0 auto;">
|
<a-form style="width: 100%; margin: 0 auto">
|
||||||
<div class="ns-form-title"><div class="title">因子分类</div></div>
|
<div class="ns-form-title"><div class="title">因子分类</div></div>
|
||||||
<div style="padding: 0 16px !important;width: 100%;">
|
<div style="padding: 0 16px !important; width: 100%">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24" style="margin-bottom: 16px;">
|
<a-col :span="24" style="margin-bottom: 16px">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-model:value="searchValue"
|
v-model:value="searchValue"
|
||||||
placeholder="请输入关键词"
|
placeholder="请输入关键词"
|
||||||
@search="onSearchTreeData"
|
@search="onSearchTreeData" />
|
||||||
/>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -25,13 +24,15 @@
|
|||||||
show-line
|
show-line
|
||||||
@expand="onExpand"
|
@expand="onExpand"
|
||||||
@select="onSelect"
|
@select="onSelect"
|
||||||
style="padding: 0 16px !important;"
|
style="padding: 0 16px !important">
|
||||||
>
|
|
||||||
<template #title="data">
|
<template #title="data">
|
||||||
<span v-if="data.energyType && searchValue && data.energyType.indexOf(searchValue) > -1">
|
<span
|
||||||
|
v-if="data.energyType && searchValue && data.energyType.indexOf(searchValue) > -1">
|
||||||
{{ data.energyType.substring(0, data.energyType.indexOf(searchValue)) }}
|
{{ data.energyType.substring(0, data.energyType.indexOf(searchValue)) }}
|
||||||
<span style="color: #f50">{{ searchValue }}</span>
|
<span style="color: #f50">{{ searchValue }}</span>
|
||||||
{{ data.energyType.substring(data.energyType.indexOf(searchValue) + searchValue.length) }}
|
{{
|
||||||
|
data.energyType.substring(data.energyType.indexOf(searchValue) + searchValue.length)
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
<span v-else>{{ data.energyType }}</span>
|
<span v-else>{{ data.energyType }}</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -61,33 +62,35 @@
|
|||||||
</template>
|
</template>
|
||||||
</a-table> -->
|
</a-table> -->
|
||||||
<ns-view-list-table v-bind="tableConfig" :model="tableData" ref="mainRef" />
|
<ns-view-list-table v-bind="tableConfig" :model="tableData" ref="mainRef" />
|
||||||
<a-pagination
|
<a-pagination
|
||||||
:current="queryParams.pageNum"
|
:current="queryParams.pageNum"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page-size="queryParams.pageSize"
|
:page-size="queryParams.pageSize"
|
||||||
style="display: flex;justify-content: center;margin-top: 16px;"
|
style="display: flex; justify-content: center; margin-top: 16px"
|
||||||
:show-size-changer="true"
|
:show-size-changer="true"
|
||||||
:show-quick-jumper="true"
|
:show-quick-jumper="true"
|
||||||
@change="onChange" />
|
@change="onChange" />
|
||||||
<!-- 新增/编辑 -->
|
<!-- 新增/编辑 -->
|
||||||
<a-drawer
|
<a-drawer
|
||||||
:width="700"
|
:width="700"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
:body-style="{ paddingBottom: '80px' }"
|
:body-style="{ paddingBottom: '80px' }"
|
||||||
:footer-style="{ textAlign: 'right' }"
|
:footer-style="{ textAlign: 'right' }"
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
@close="onClose">
|
@close="onClose">
|
||||||
<a-form
|
<a-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="formState"
|
:model="formState"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
:label-col="labelCol"
|
:label-col="labelCol"
|
||||||
:wrapper-col="wrapperCol"
|
:wrapper-col="wrapperCol">
|
||||||
>
|
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
<a-form-item ref="name" label="日期范围" name="dateRange">
|
<a-form-item ref="name" label="日期范围" name="dateRange">
|
||||||
<a-range-picker v-model:value="formState.dateRange" picker="month" valueFormat="YYYY-MM" />
|
<a-range-picker
|
||||||
|
v-model:value="formState.dateRange"
|
||||||
|
picker="month"
|
||||||
|
valueFormat="YYYY-MM" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
@@ -103,20 +106,24 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
<a-table
|
<a-table
|
||||||
:columns="drawerColumns"
|
:columns="drawerColumns"
|
||||||
:data-source="newTableData"
|
:data-source="newTableData"
|
||||||
bordered
|
bordered
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectionChange, type: 'radio' }"
|
:rowSelection="{
|
||||||
:pagination="false">
|
selectedRowKeys: selectedRowKeys,
|
||||||
</a-table>
|
onChange: onSelectionChange,
|
||||||
<template #footer>
|
type: 'radio',
|
||||||
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
}"
|
||||||
<a-button type="primary" @click="onSubmit">确定</a-button>
|
:pagination="false">
|
||||||
</template>
|
</a-table>
|
||||||
</a-drawer>
|
<template #footer>
|
||||||
|
<a-button style="margin-right: 8px" @click="onClose">取消</a-button>
|
||||||
|
<a-button type="primary" @click="onSubmit">确定</a-button>
|
||||||
|
</template>
|
||||||
|
</a-drawer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -124,10 +131,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, watch, toRaw } from 'vue';
|
import { ref, watch, toRaw } from 'vue';
|
||||||
import type { TreeProps } from 'ant-design-vue';
|
import type { TreeProps } from 'ant-design-vue';
|
||||||
import { Pagination,Modal } from 'ant-design-vue';
|
import { Pagination, Modal } from 'ant-design-vue';
|
||||||
import { columns,drawerColumns } from '../config';
|
import { columns, drawerColumns } from '../config';
|
||||||
import { http } from '/nerv-lib/util/http';
|
import { http } from '/nerv-lib/util/http';
|
||||||
import { quickCalculation,carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
import {
|
||||||
|
quickCalculation,
|
||||||
|
carbonEmissionFactorLibrary,
|
||||||
|
} from '/@/api/carbonEmissionFactorLibrary';
|
||||||
|
import { or } from '@vueuse/core';
|
||||||
defineOptions({
|
defineOptions({
|
||||||
energyType: 'quickCalculation', // 与页面路由name一致缓存才可生效
|
energyType: 'quickCalculation', // 与页面路由name一致缓存才可生效
|
||||||
components: {
|
components: {
|
||||||
@@ -137,7 +148,7 @@
|
|||||||
const orgId = ref('');
|
const orgId = ref('');
|
||||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||||
orgId.value = result;
|
orgId.value = result;
|
||||||
const fetch = (api, params = { orgId } ) => {
|
const fetch = (api, params = { orgId }) => {
|
||||||
return http.post(api, params);
|
return http.post(api, params);
|
||||||
};
|
};
|
||||||
const mainRef = ref();
|
const mainRef = ref();
|
||||||
@@ -191,7 +202,7 @@
|
|||||||
for (let i = 0; i < tree.length; i++) {
|
for (let i = 0; i < tree.length; i++) {
|
||||||
const node = tree[i];
|
const node = tree[i];
|
||||||
if (node.children) {
|
if (node.children) {
|
||||||
if (node.children.some(item => item.key === key)) {
|
if (node.children.some((item) => item.key === key)) {
|
||||||
parentKey = node.key;
|
parentKey = node.key;
|
||||||
} else if (getParentKey(key, node.children)) {
|
} else if (getParentKey(key, node.children)) {
|
||||||
parentKey = getParentKey(key, node.children);
|
parentKey = getParentKey(key, node.children);
|
||||||
@@ -211,17 +222,17 @@
|
|||||||
autoExpandParent.value = false;
|
autoExpandParent.value = false;
|
||||||
};
|
};
|
||||||
// 被选中的树节点
|
// 被选中的树节点
|
||||||
const energyType = ref()
|
const energyType = ref();
|
||||||
const onSelect = (selectedKey: string[], info: any) => {
|
const onSelect = (selectedKey: string[], info: any) => {
|
||||||
selectedKeys.value = selectedKey;
|
selectedKeys.value = selectedKey;
|
||||||
if(info.selected){
|
if (info.selected) {
|
||||||
energyType.value = info.node.id
|
energyType.value = info.node.id;
|
||||||
statsId.value = info.node.id
|
statsId.value = info.node.id;
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(searchValue, value => {
|
watch(searchValue, (value) => {
|
||||||
const expanded = dataList
|
const expanded = dataList
|
||||||
.map((item: TreeProps['treeData'][number]) => {
|
.map((item: TreeProps['treeData'][number]) => {
|
||||||
if (item.title.indexOf(value) > -1) {
|
if (item.title.indexOf(value) > -1) {
|
||||||
@@ -235,34 +246,33 @@
|
|||||||
autoExpandParent.value = true;
|
autoExpandParent.value = true;
|
||||||
});
|
});
|
||||||
// 查询因子分类树数据
|
// 查询因子分类树数据
|
||||||
const onSearchTreeData = () => {
|
const onSearchTreeData = () => {};
|
||||||
};
|
const statsId = ref();
|
||||||
const statsId = ref()
|
|
||||||
// 获取因子分类树数据
|
// 获取因子分类树数据
|
||||||
const getTreeData = () => {
|
const getTreeData = () => {
|
||||||
fetch(quickCalculation.carbonQuickTree).then((res) => {
|
fetch(quickCalculation.carbonQuickTree, { orgId: orgId.value }).then((res) => {
|
||||||
gData.value = res.data
|
gData.value = res.data;
|
||||||
energyType.value = gData.value[0].children[0].id
|
energyType.value = gData.value[0].children[0].id;
|
||||||
statsId.value = gData.value[0].children[0].id
|
statsId.value = gData.value[0].children[0].id;
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
getTreeData()
|
getTreeData();
|
||||||
// 列表数据
|
// 列表数据
|
||||||
const total = ref<number>()
|
const total = ref<number>();
|
||||||
const queryParams = ref({
|
const queryParams = ref({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orgId: orgId.value
|
orgId: orgId.value,
|
||||||
})
|
});
|
||||||
const tableData = ref([]);
|
const tableData = ref([]);
|
||||||
|
|
||||||
const tableConfig = ref({
|
const tableConfig = ref({
|
||||||
title: '排放因子库',
|
title: '排放因子库',
|
||||||
api: quickCalculation.queryCarbonEmissionPage,
|
api: quickCalculation.queryCarbonEmissionPage,
|
||||||
params: {
|
params: {
|
||||||
orgId,
|
orgId,
|
||||||
energyType
|
energyType,
|
||||||
},
|
},
|
||||||
headerActions: [
|
headerActions: [
|
||||||
{
|
{
|
||||||
@@ -270,8 +280,8 @@
|
|||||||
name: 'userAdd',
|
name: 'userAdd',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
handle: () => {
|
handle: () => {
|
||||||
visible.value = true
|
visible.value = true;
|
||||||
getNewTable()
|
getNewTable();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -320,12 +330,12 @@
|
|||||||
name: 'userEdit',
|
name: 'userEdit',
|
||||||
handle: (record: any) => {
|
handle: (record: any) => {
|
||||||
selectedRowKeys.value = [record.factorId];
|
selectedRowKeys.value = [record.factorId];
|
||||||
formState.value.id = record.id
|
formState.value.id = record.id;
|
||||||
formState.value.emissionFactors = record.emissionFactors
|
formState.value.emissionFactors = record.emissionFactors;
|
||||||
formState.value.dateRange = [record.startTime, record.endTime];
|
formState.value.dateRange = [record.startTime, record.endTime];
|
||||||
formState.value.factorId = record.factorId
|
formState.value.factorId = record.factorId;
|
||||||
visible.value = true
|
visible.value = true;
|
||||||
getNewTable()
|
getNewTable();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -342,13 +352,13 @@
|
|||||||
});
|
});
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
const getTableList = () => {
|
const getTableList = () => {
|
||||||
fetch(quickCalculation.queryCarbonEmissionPage,queryParams.value).then((res) => {
|
fetch(quickCalculation.queryCarbonEmissionPage, queryParams.value).then((res) => {
|
||||||
tableData.value = res.data.records
|
tableData.value = res.data.records;
|
||||||
total.value = res.data.total
|
total.value = res.data.total;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 分页器
|
// 分页器
|
||||||
const onChange = (pageNumber: number,size: number) => {
|
const onChange = (pageNumber: number, size: number) => {
|
||||||
queryParams.value.pageNum = pageNumber;
|
queryParams.value.pageNum = pageNumber;
|
||||||
queryParams.value.pageSize = size;
|
queryParams.value.pageSize = size;
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
@@ -357,9 +367,11 @@
|
|||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const labelCol = { span: 6 };
|
const labelCol = { span: 6 };
|
||||||
const wrapperCol = { span: 18 };
|
const wrapperCol = { span: 18 };
|
||||||
const formState = ref({})
|
const formState = ref({
|
||||||
|
orgId: orgId.value,
|
||||||
|
});
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
|
|
||||||
// 定义form表单的必填
|
// 定义form表单的必填
|
||||||
const rules: Record<string, Rule[]> = {
|
const rules: Record<string, Rule[]> = {
|
||||||
dateRange: [{ required: true, message: '请选择日期范围', trigger: 'change' }],
|
dateRange: [{ required: true, message: '请选择日期范围', trigger: 'change' }],
|
||||||
@@ -367,65 +379,65 @@
|
|||||||
};
|
};
|
||||||
// 点击新增按钮
|
// 点击新增按钮
|
||||||
const addNewData = () => {
|
const addNewData = () => {
|
||||||
visible.value = true
|
visible.value = true;
|
||||||
getNewTable()
|
getNewTable();
|
||||||
};
|
};
|
||||||
// 获取新增页面的列表
|
// 获取新增页面的列表
|
||||||
const selectedRowKeys = ref([]);
|
const selectedRowKeys = ref([]);
|
||||||
const onSelectionChange = (selectedKeys, selectedRows) => {
|
const onSelectionChange = (selectedKeys, selectedRows) => {
|
||||||
selectedRowKeys.value = selectedKeys;
|
selectedRowKeys.value = selectedKeys;
|
||||||
formState.value.emissionFactors = selectedRows[0].emissionFactors
|
formState.value.emissionFactors = selectedRows[0].emissionFactors;
|
||||||
formState.value.factorId = selectedRows[0].id
|
formState.value.factorId = selectedRows[0].id;
|
||||||
};
|
};
|
||||||
const queryData = ref({
|
const queryData = ref({
|
||||||
orgId: orgId.value,
|
orgId: orgId.value,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 999
|
pageSize: 999,
|
||||||
})
|
});
|
||||||
const newTableData = ref([])
|
const newTableData = ref([]);
|
||||||
const getNewTable = () => {
|
const getNewTable = () => {
|
||||||
fetch(carbonEmissionFactorLibrary.getTableList,queryData.value).then((res) => {
|
fetch(carbonEmissionFactorLibrary.getTableList, queryData.value).then((res) => {
|
||||||
newTableData.value = res.data.records
|
newTableData.value = res.data.records;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// 点击编辑按钮
|
// 点击编辑按钮
|
||||||
const editData = (record) =>{
|
const editData = (record) => {
|
||||||
selectedRowKeys.value = [record.factorId];
|
selectedRowKeys.value = [record.factorId];
|
||||||
formState.value.id = record.id
|
formState.value.id = record.id;
|
||||||
formState.value.emissionFactors = record.emissionFactors
|
formState.value.emissionFactors = record.emissionFactors;
|
||||||
formState.value.dateRange = [record.startTime, record.endTime];
|
formState.value.dateRange = [record.startTime, record.endTime];
|
||||||
formState.value.factorId = record.factorId
|
formState.value.factorId = record.factorId;
|
||||||
visible.value = true
|
visible.value = true;
|
||||||
getNewTable()
|
getNewTable();
|
||||||
};
|
};
|
||||||
// 点击确定提交
|
// 点击确定提交
|
||||||
const onSubmit = () => {
|
const onSubmit = () => {
|
||||||
formRef.value
|
formRef.value
|
||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
formState.value.statsId = statsId.value
|
formState.value.statsId = statsId.value;
|
||||||
formState.value.startTime = formState.value.dateRange[0]
|
formState.value.startTime = formState.value.dateRange[0];
|
||||||
formState.value.endTime = formState.value.dateRange[1]
|
formState.value.endTime = formState.value.dateRange[1];
|
||||||
console.log('values', formState, toRaw(formState));
|
console.log('values', formState, toRaw(formState));
|
||||||
if(formState.value.id){
|
if (formState.value.id) {
|
||||||
fetch(quickCalculation.update,formState.value).then((res) => {
|
fetch(quickCalculation.update, formState.value).then((res) => {
|
||||||
visible.value = false
|
visible.value = false;
|
||||||
selectedRowKeys.value = [];
|
selectedRowKeys.value = [];
|
||||||
formState.value = {}
|
formState.value = {};
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
fetch(quickCalculation.creat,formState.value).then((res) => {
|
fetch(quickCalculation.creat, formState.value).then((res) => {
|
||||||
visible.value = false
|
visible.value = false;
|
||||||
selectedRowKeys.value = [];
|
selectedRowKeys.value = [];
|
||||||
formState.value = {}
|
formState.value = {};
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -438,9 +450,9 @@
|
|||||||
okType: 'primary',
|
okType: 'primary',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk() {
|
onOk() {
|
||||||
fetch(quickCalculation.del , {id : record.id }).then((res) => {
|
fetch(quickCalculation.del, { id: record.id }).then((res) => {
|
||||||
message.success('操作成功!');
|
message.success('操作成功!');
|
||||||
getTableList()
|
getTableList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onCancel() {
|
onCancel() {
|
||||||
@@ -452,7 +464,7 @@
|
|||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
selectedRowKeys.value = [];
|
selectedRowKeys.value = [];
|
||||||
formState.value = {}
|
formState.value = {};
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -474,9 +486,9 @@
|
|||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
.top{
|
.top {
|
||||||
position: relative;
|
position: relative;
|
||||||
.addTreeNode{
|
.addTreeNode {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -499,7 +511,7 @@
|
|||||||
.top {
|
.top {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
.ns-form-title{
|
.ns-form-title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
user-select: text;
|
user-select: text;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
@@ -507,7 +519,7 @@
|
|||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
border-bottom: 1px solid #e9e9e9;
|
border-bottom: 1px solid #e9e9e9;
|
||||||
}
|
}
|
||||||
.title{
|
.title {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
@@ -525,17 +537,17 @@
|
|||||||
height: 13px;
|
height: 13px;
|
||||||
width: 3px;
|
width: 3px;
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
background-color: #2778FF;
|
background-color: #2778ff;
|
||||||
}
|
}
|
||||||
:deep(.ant-table-title) {
|
:deep(.ant-table-title) {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.ns-table-title{
|
.ns-table-title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.buttonGroup{
|
.buttonGroup {
|
||||||
margin-left: 1vw;
|
margin-left: 1vw;
|
||||||
width: 5vw;
|
width: 5vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -547,4 +559,4 @@
|
|||||||
td.column-money {
|
td.column-money {
|
||||||
text-align: right !important;
|
text-align: right !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -20,8 +20,7 @@
|
|||||||
:model="formState"
|
:model="formState"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
:label-col="labelCol"
|
:label-col="labelCol"
|
||||||
:wrapper-col="wrapperCol"
|
:wrapper-col="wrapperCol">
|
||||||
>
|
|
||||||
<a-form-item ref="name" label="报告名称" name="reportName">
|
<a-form-item ref="name" label="报告名称" name="reportName">
|
||||||
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" />
|
<a-input v-model:value="formState.reportName" placeholder="请输入报告名称" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -38,7 +37,10 @@
|
|||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item ref="name" label="报告范围" name="reportScope">
|
<a-form-item ref="name" label="报告范围" name="reportScope">
|
||||||
<a-range-picker v-model:value="formState.reportScope" picker="month" valueFormat="YYYY-MM" />
|
<a-range-picker
|
||||||
|
v-model:value="formState.reportScope"
|
||||||
|
picker="month"
|
||||||
|
valueFormat="YYYY-MM" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
@@ -49,7 +51,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref,toRaw } from 'vue';
|
import { ref, toRaw } from 'vue';
|
||||||
import { http } from '/nerv-lib/util/http';
|
import { http } from '/nerv-lib/util/http';
|
||||||
import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary';
|
import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary';
|
||||||
import fillIn from './fillInPage/index.vue';
|
import fillIn from './fillInPage/index.vue';
|
||||||
@@ -65,7 +67,7 @@
|
|||||||
const fillInPage = ref(false);
|
const fillInPage = ref(false);
|
||||||
// 新增相关数据
|
// 新增相关数据
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const formState = ref({})
|
const formState = ref({});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const labelCol = { span: 5 };
|
const labelCol = { span: 5 };
|
||||||
const wrapperCol = { span: 19 };
|
const wrapperCol = { span: 19 };
|
||||||
@@ -80,7 +82,7 @@
|
|||||||
// 关闭新增抽屉
|
// 关闭新增抽屉
|
||||||
const onClose = () => {
|
const onClose = () => {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
formState.value = {}
|
formState.value = {};
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
};
|
};
|
||||||
// 点击确定提交
|
// 点击确定提交
|
||||||
@@ -89,15 +91,15 @@
|
|||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('values', formState, toRaw(formState));
|
console.log('values', formState, toRaw(formState));
|
||||||
formState.value.enterpriseOrgId = orgId.value
|
formState.value.enterpriseOrgId = orgId.value;
|
||||||
formState.value.startTime = formState.value.reportScope[0]
|
formState.value.startTime = formState.value.reportScope[0];
|
||||||
formState.value.endTime = formState.value.reportScope[1]
|
formState.value.endTime = formState.value.reportScope[1];
|
||||||
fetch(carbonInventoryCheck.createOrUpdate,formState.value).then((res) => {
|
fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => {
|
||||||
visible.value = false
|
visible.value = false;
|
||||||
mainRef.value?.nsTableRef.reload();
|
mainRef.value?.nsTableRef.reload();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
console.log('error', error);
|
console.log('error', error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -110,7 +112,7 @@
|
|||||||
title: '数据库',
|
title: '数据库',
|
||||||
api: carbonInventoryCheck.carbonInventoryList,
|
api: carbonInventoryCheck.carbonInventoryList,
|
||||||
params: {
|
params: {
|
||||||
orgId
|
orgId,
|
||||||
},
|
},
|
||||||
headerActions: [
|
headerActions: [
|
||||||
{
|
{
|
||||||
@@ -118,7 +120,7 @@
|
|||||||
name: 'userAdd',
|
name: 'userAdd',
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
handle: () => {
|
handle: () => {
|
||||||
visible.value = true
|
visible.value = true;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -161,10 +163,10 @@
|
|||||||
label: '编辑',
|
label: '编辑',
|
||||||
name: 'userEdit',
|
name: 'userEdit',
|
||||||
handle: (record: any) => {
|
handle: (record: any) => {
|
||||||
visible.value = true
|
visible.value = true;
|
||||||
fetch(carbonInventoryCheck.findById,{id:record.id}).then((res) => {
|
fetch(carbonInventoryCheck.findById, { id: record.id }).then((res) => {
|
||||||
formState.value = res.data
|
formState.value = res.data;
|
||||||
formState.value.reportScope = [res.data.startTime,res.data.endTime]
|
formState.value.reportScope = [res.data.startTime, res.data.endTime];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -172,17 +174,16 @@
|
|||||||
label: '填报',
|
label: '填报',
|
||||||
name: 'fillIn',
|
name: 'fillIn',
|
||||||
handle: (record: any) => {
|
handle: (record: any) => {
|
||||||
isMainPage.value = false
|
isMainPage.value = false;
|
||||||
fillInPage.value = true
|
fillInPage.value = true;
|
||||||
reportId.value = record.id
|
reportId.value = record.id;
|
||||||
year.value = record.reportYear
|
year.value = record.reportYear;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '下载',
|
label: '下载',
|
||||||
name: 'download',
|
name: 'download',
|
||||||
handle: (record: any) => {
|
handle: (record: any) => {},
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
@@ -213,7 +214,7 @@
|
|||||||
componentProps: {
|
componentProps: {
|
||||||
valueFormat: 'YYYY',
|
valueFormat: 'YYYY',
|
||||||
placeholder: ['报告年度', '报告年度'],
|
placeholder: ['报告年度', '报告年度'],
|
||||||
picker:"year"
|
picker: 'year',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -222,12 +223,10 @@
|
|||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
});
|
});
|
||||||
// 填报页点击返回
|
// 填报页点击返回
|
||||||
const updateData = (newDataOne,newDataTwo) => {
|
const updateData = (newDataOne, newDataTwo) => {
|
||||||
isMainPage.value = newDataOne
|
isMainPage.value = newDataOne;
|
||||||
fillInPage.value = newDataTwo
|
fillInPage.value = newDataTwo;
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,53 +1,47 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="map-box">
|
<div class="map-box">
|
||||||
<div class="map">
|
<div class="map">
|
||||||
<liftInfo></liftInfo>
|
<liftInfo />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import liftInfo from './liftInfo.vue'
|
import liftInfo from './liftInfo.vue';
|
||||||
// 请求
|
// 请求
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
|
|
||||||
// 初始化 ===========================================================
|
// 初始化 ===========================================================
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {});
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
// tab页部分 ========================================================
|
|
||||||
|
|
||||||
// 表格数据
|
|
||||||
const dataSource = ref([]);
|
|
||||||
|
|
||||||
|
// tab页部分 ========================================================
|
||||||
|
|
||||||
|
// 表格数据
|
||||||
|
const dataSource = ref([]);
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.map-box {
|
.map-box {
|
||||||
// 颜色变量,用于区别颜色
|
// 颜色变量,用于区别颜色
|
||||||
|
|
||||||
// 正常 - 开启 - 上行 -下行
|
// 正常 - 开启 - 上行 -下行
|
||||||
--on: #0DFFA4;
|
--on: #0dffa4;
|
||||||
// 关闭
|
// 关闭
|
||||||
--off: #BFCDE2;
|
--off: #bfcde2;
|
||||||
// 暂停 - 维修
|
// 暂停 - 维修
|
||||||
--pause: #FFBC46;
|
--pause: #ffbc46;
|
||||||
// 告警 - 急停
|
// 告警 - 急停
|
||||||
--stop: #F36163;
|
--stop: #f36163;
|
||||||
// 故障
|
// 故障
|
||||||
--fault: #FF7636;
|
--fault: #ff7636;
|
||||||
// 未知
|
// 未知
|
||||||
--unknown: #A742FF;
|
--unknown: #a742ff;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.map {
|
.map {
|
||||||
width: 1280px;
|
width: 1280px;
|
||||||
height: 720px;
|
height: 720px;
|
||||||
background-image: url(../image/bg.jpg);
|
background-image: url(../image/bg.jpg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<div class="item-box">
|
<div class="item-box">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<div class="icon-item">
|
<div class="icon-item">
|
||||||
<img src="../image/liftState/lift-normal.svg" alt="">
|
<img src="../image/liftState/lift-normal.svg" alt="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<div class="item-box">
|
<div class="item-box">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<div class="icon-item">
|
<div class="icon-item">
|
||||||
<img src="../image/liftState/lift-normal.svg" alt="">
|
<img src="../image/liftState/lift-normal.svg" alt="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<div class="item-box">
|
<div class="item-box">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<div class="icon-item">
|
<div class="icon-item">
|
||||||
<img src="../image/liftState/lift-normal.svg" alt="">
|
<img src="../image/liftState/lift-normal.svg" alt="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -43,109 +43,104 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
|
||||||
// 请求
|
// 请求
|
||||||
|
|
||||||
// 初始化 ===========================================================
|
// 初始化 ===========================================================
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {});
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
// tab页部分 ========================================================
|
|
||||||
|
|
||||||
// 运行状态
|
|
||||||
const runState = ref('1');
|
|
||||||
// 电梯状态
|
|
||||||
const liftState = ref('2');
|
|
||||||
|
|
||||||
|
// tab页部分 ========================================================
|
||||||
|
|
||||||
|
// 运行状态
|
||||||
|
const runState = ref('1');
|
||||||
|
// 电梯状态
|
||||||
|
const liftState = ref('2');
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// 面板
|
// 面板
|
||||||
.info-box {
|
.info-box {
|
||||||
// 字体颜色变量
|
// 字体颜色变量
|
||||||
--text: rgb(20, 255, 255);
|
--text: rgb(20, 255, 255);
|
||||||
|
|
||||||
width: 240px;
|
width: 240px;
|
||||||
height: 130px;
|
height: 130px;
|
||||||
display: flex;
|
|
||||||
gap: 5px;
|
|
||||||
flex-direction: column;
|
|
||||||
background: rgb(17, 44, 86, 0.9);
|
|
||||||
border-radius: 8px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 8px;
|
|
||||||
border: 3px solid var(--text);
|
|
||||||
// 面板标题
|
|
||||||
.box-title {
|
|
||||||
height: auto;
|
|
||||||
color: var(--text);
|
|
||||||
// 标题前小方块
|
|
||||||
.dot {
|
|
||||||
display: inline-block;
|
|
||||||
width: 2px;
|
|
||||||
height: 16px;
|
|
||||||
vertical-align: middle;
|
|
||||||
background: var(--text);
|
|
||||||
}
|
|
||||||
// 标题
|
|
||||||
span {
|
|
||||||
padding-left: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 下半部分
|
|
||||||
.box-inner {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 10px;
|
gap: 5px;
|
||||||
// 单个盒子(3盒子)
|
flex-direction: column;
|
||||||
.item {
|
background: rgb(17, 44, 86, 0.9);
|
||||||
|
border-radius: 8px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 8px;
|
||||||
|
border: 3px solid var(--text);
|
||||||
|
// 面板标题
|
||||||
|
.box-title {
|
||||||
|
height: auto;
|
||||||
|
color: var(--text);
|
||||||
|
// 标题前小方块
|
||||||
|
.dot {
|
||||||
|
display: inline-block;
|
||||||
|
width: 2px;
|
||||||
|
height: 16px;
|
||||||
|
vertical-align: middle;
|
||||||
|
background: var(--text);
|
||||||
|
}
|
||||||
|
// 标题
|
||||||
|
span {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 下半部分
|
||||||
|
.box-inner {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
padding: 0 10px;
|
||||||
// 盒子中放置图片的容器
|
// 单个盒子(3盒子)
|
||||||
.item-box {
|
.item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
flex-direction: column;
|
||||||
justify-content: center;
|
// 盒子中放置图片的容器
|
||||||
// border: 1px solid red;
|
.item-box {
|
||||||
.icon {
|
flex: 1;
|
||||||
width: 55px;
|
display: flex;
|
||||||
height: 55px;
|
align-items: center;
|
||||||
background-image: url(../image/box.svg);
|
justify-content: center;
|
||||||
background-size: 130% 130%;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: left -8px top -8px;
|
|
||||||
// border: 1px solid red;
|
// border: 1px solid red;
|
||||||
position: relative;
|
.icon {
|
||||||
.icon-item {
|
width: 55px;
|
||||||
position: absolute;
|
height: 55px;
|
||||||
width: 20px;
|
background-image: url(../image/box.svg);
|
||||||
height: 20px;
|
background-size: 130% 130%;
|
||||||
left: 0;
|
background-repeat: no-repeat;
|
||||||
right: 0;
|
background-position: left -8px top -8px;
|
||||||
bottom: 0;
|
// border: 1px solid red;
|
||||||
top: 0;
|
position: relative;
|
||||||
margin: auto;
|
.icon-item {
|
||||||
img {
|
position: absolute;
|
||||||
width: 100%;
|
width: 20px;
|
||||||
height: 100%;
|
height: 20px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
top: 0;
|
||||||
|
margin: auto;
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
.item-text {
|
||||||
.item-text {
|
height: 20px;
|
||||||
height: 20px;
|
text-align: center;
|
||||||
text-align: center;
|
font-size: 12px;
|
||||||
font-size: 12px;
|
color: white;
|
||||||
color: white;
|
user-select: none;
|
||||||
user-select: none;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,273 +1,276 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="lighting-box">
|
<div class="lighting-box">
|
||||||
<div class="lighting-img-box">
|
<div class="lighting-img-box">
|
||||||
<!-- 左上角,区域切换 -->
|
<!-- 左上角,区域切换 -->
|
||||||
<div class="btn-box">
|
<div class="btn-box">
|
||||||
<button v-for="item in floorData" class="btn-item" @click=changeFloor(item.childList)>{{ item.name }}</button>
|
<button v-for="item in floorData" class="btn-item" @click="changeFloor(item.childList)">{{
|
||||||
</div>
|
item.name
|
||||||
<!-- 楼层区域 -->
|
}}</button>
|
||||||
<div class="area">
|
</div>
|
||||||
<div
|
<!-- 楼层区域 -->
|
||||||
v-for="(item, index) in treeData"
|
<div class="area">
|
||||||
:class="computedClass(item.id)"
|
<div
|
||||||
@click="changeThisArea([item])"
|
v-for="(item, index) in treeData"
|
||||||
:key="index">
|
:class="computedClass(item.id)"
|
||||||
<div v-for="(v, i) in item.childList" :key="i" class="light-group">
|
@click="changeThisArea([item])"
|
||||||
<div class="group-shadow" @click.stop="changeThisArea([item, v])">
|
:key="index">
|
||||||
<div :class="computedClass(v.id)" class="shadow-box"></div>
|
<div v-for="(v, i) in item.childList" :key="i" class="light-group">
|
||||||
</div>
|
<div class="group-shadow" @click.stop="changeThisArea([item, v])">
|
||||||
</div>
|
<div :class="computedClass(v.id)" class="shadow-box"></div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 照明设备 -->
|
|
||||||
<div class="lights">
|
|
||||||
<light v-for="(item, index) in bulbs"
|
|
||||||
:key="index"
|
|
||||||
:styleObject="item.styleText"
|
|
||||||
:type="item.type"
|
|
||||||
:visible="item.visible">
|
|
||||||
</light>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 右侧抽屉的触发按钮 -->
|
</div>
|
||||||
<div class="drawer-box-in" v-if="!visible" @click="toggleDrawer">
|
<!-- 照明设备 -->
|
||||||
<double-left-outlined class="drawer-icon" style="color: white" />
|
<div class="lights">
|
||||||
</div>
|
<light
|
||||||
<!-- 左侧抽屉的关闭按钮 -->
|
v-for="(item, index) in bulbs"
|
||||||
<div class="drawer-box-out" v-if="visible" @click="toggleDrawer">
|
:key="index"
|
||||||
<double-right-outlined class="drawer-icon" style="color: white;" />
|
:styleObject="item.styleText"
|
||||||
</div>
|
:type="item.type"
|
||||||
<!-- 右侧抽屉 -->
|
:visible="item.visible" />
|
||||||
<a-drawer
|
</div>
|
||||||
v-model:visible="visible"
|
|
||||||
class="drawer-item"
|
|
||||||
width="496"
|
|
||||||
placement="right"
|
|
||||||
:body-style="{ background: 'rgba(0, 0, 0)', opacity: 0.8 }"
|
|
||||||
:closable="false"
|
|
||||||
id="drawer"
|
|
||||||
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
|
|
||||||
<a-tabs v-model:activeKey="activeKey">
|
|
||||||
<a-tab-pane key="1" tab="控制面板">
|
|
||||||
<tabs1
|
|
||||||
ref="tabs1Ref"
|
|
||||||
@changeArea="changeArea"
|
|
||||||
@reset="reset"
|
|
||||||
:treeData="treeData"
|
|
||||||
:nowArea="nowArea"
|
|
||||||
></tabs1>
|
|
||||||
</a-tab-pane>
|
|
||||||
<a-tab-pane key="2" tab="计划列表" force-render>
|
|
||||||
<tabs2></tabs2>
|
|
||||||
</a-tab-pane>
|
|
||||||
<a-tab-pane key="3" tab="日志">
|
|
||||||
<tabs3></tabs3>
|
|
||||||
</a-tab-pane>
|
|
||||||
</a-tabs>
|
|
||||||
</a-drawer>
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 右侧抽屉的触发按钮 -->
|
||||||
|
<div class="drawer-box-in" v-if="!visible" @click="toggleDrawer">
|
||||||
|
<double-left-outlined class="drawer-icon" style="color: white" />
|
||||||
|
</div>
|
||||||
|
<!-- 左侧抽屉的关闭按钮 -->
|
||||||
|
<div class="drawer-box-out" v-if="visible" @click="toggleDrawer">
|
||||||
|
<double-right-outlined class="drawer-icon" style="color: white" />
|
||||||
|
</div>
|
||||||
|
<!-- 右侧抽屉 -->
|
||||||
|
<a-drawer
|
||||||
|
v-model:visible="visible"
|
||||||
|
class="drawer-item"
|
||||||
|
width="496"
|
||||||
|
:forceRender="preload"
|
||||||
|
placement="right"
|
||||||
|
:body-style="{ background: 'rgba(0, 0, 0)', opacity: 0.8 }"
|
||||||
|
:closable="false"
|
||||||
|
id="drawer"
|
||||||
|
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
|
||||||
|
<a-tabs v-model:activeKey="activeKey">
|
||||||
|
<a-tab-pane key="1" tab="控制面板">
|
||||||
|
<tabs1 ref="tabs1Ref" @changeArea="changeArea" @reset="reset" :treeData="treeData" />
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="2" tab="计划列表" force-render>
|
||||||
|
<tabs2 />
|
||||||
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="3" tab="日志">
|
||||||
|
<tabs3 />
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
</a-drawer>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
// 组件
|
||||||
|
import light from './light.vue';
|
||||||
|
import tabs1 from './tabs1.vue';
|
||||||
|
import tabs2 from './tabs2.vue';
|
||||||
|
import tabs3 from './tabs3.vue';
|
||||||
|
// 请求
|
||||||
|
import { http } from '/nerv-lib/util/http';
|
||||||
|
import { lightingManage } from '/@/api/IlluminationInfo';
|
||||||
|
// ICON
|
||||||
|
import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
import { ref, onMounted } from 'vue';
|
// 初始化 =======================================================
|
||||||
// 组件
|
|
||||||
import light from './light.vue';
|
|
||||||
import tabs1 from './tabs1.vue'
|
|
||||||
import tabs2 from './tabs2.vue'
|
|
||||||
import tabs3 from './tabs3.vue'
|
|
||||||
// 请求
|
|
||||||
import { http } from '/nerv-lib/util/http';
|
|
||||||
import { lightingManage } from '/@/api/IlluminationInfo';
|
|
||||||
// ICON
|
|
||||||
import {
|
|
||||||
DoubleLeftOutlined,
|
|
||||||
DoubleRightOutlined
|
|
||||||
} from '@ant-design/icons-vue';
|
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
// 初始化 =======================================================
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
// 获得分区与线路的结构
|
// 获得分区与线路的结构
|
||||||
getAllArea()
|
getAllArea();
|
||||||
})
|
});
|
||||||
|
|
||||||
// 分层业务 =====================================================
|
// 预加载flag,获得分区数据后,预加载抽屉,防止获取ref报错
|
||||||
|
const preload = ref(false);
|
||||||
|
|
||||||
// 所有楼层的数据
|
// 分层业务 =====================================================
|
||||||
const floorData = ref([])
|
|
||||||
// 左上角分层切换
|
// 所有楼层的数据
|
||||||
const changeFloor = (area: any) => {
|
const floorData = ref([]);
|
||||||
|
// 左上角分层切换
|
||||||
|
const changeFloor = (area: any) => {
|
||||||
// 重置数据
|
// 重置数据
|
||||||
reset()
|
reset();
|
||||||
// 重置视图
|
// 重置视图
|
||||||
changeArea(['1'])
|
changeArea(['1']);
|
||||||
// 切换楼层数据
|
// 切换楼层数据
|
||||||
treeData.value = area
|
treeData.value = area;
|
||||||
// 默认选择第一项
|
// 默认选择第一项
|
||||||
treeData.value[0].selected = true
|
treeData.value[0].selected = true;
|
||||||
}
|
};
|
||||||
|
|
||||||
// 分区业务 =====================================================
|
// 分区业务 =====================================================
|
||||||
|
|
||||||
// 分区结构树
|
// 分区结构树
|
||||||
const treeData = ref([])
|
const treeData = ref([]);
|
||||||
// 当前选中的分区id
|
// 当前选中的分区序列 - 用于样式渲染
|
||||||
const nowArea = ref('1')
|
const area = ref(['1']);
|
||||||
// 当前选中的分区序号 - 用于样式渲染
|
// 线路内小灯泡 - 此处位置需前端写死
|
||||||
const area = ref(['1'])
|
const bulbs = ref([
|
||||||
// 线路内小灯泡 - 此处位置需前端写死
|
|
||||||
const bulbs = ref([
|
|
||||||
{
|
{
|
||||||
styleText: { left: '180px', bottom: '200px' },
|
styleText: { left: '180px', bottom: '200px' },
|
||||||
area: 1,
|
area: 1,
|
||||||
type: 1,
|
type: 1,
|
||||||
visible: true
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
styleText: { left: '230px', bottom: '125px' },
|
styleText: { left: '230px', bottom: '125px' },
|
||||||
area: 1,
|
area: 1,
|
||||||
type: 2,
|
type: 2,
|
||||||
visible: true
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
styleText: { left: '320px', bottom: '140px' },
|
styleText: { left: '320px', bottom: '140px' },
|
||||||
area: 1,
|
area: 1,
|
||||||
type: 3,
|
type: 3,
|
||||||
visible: true
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
styleText: { left: '245px', bottom: '230px' },
|
styleText: { left: '245px', bottom: '230px' },
|
||||||
area: 1,
|
area: 1,
|
||||||
type: 3,
|
type: 3,
|
||||||
visible: true
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
styleText: { left: '405px', bottom: '230px' },
|
styleText: { left: '405px', bottom: '230px' },
|
||||||
area: 2,
|
area: 2,
|
||||||
type: 3,
|
type: 3,
|
||||||
visible: true
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
styleText: { left: '460px', bottom: '180px' },
|
styleText: { left: '460px', bottom: '180px' },
|
||||||
area: 2,
|
area: 2,
|
||||||
type: 3,
|
type: 3,
|
||||||
visible: true
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
styleText: { left: '360px', bottom: '275px' },
|
styleText: { left: '360px', bottom: '275px' },
|
||||||
area: 2,
|
area: 2,
|
||||||
type: 3,
|
type: 3,
|
||||||
visible: true
|
visible: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
styleText: { left: '715px', bottom: '320px' },
|
styleText: { left: '715px', bottom: '320px' },
|
||||||
area: 3,
|
area: 3,
|
||||||
type: 1,
|
type: 1,
|
||||||
visible: true
|
visible: true,
|
||||||
},
|
},
|
||||||
])
|
]);
|
||||||
// 由子组件控制的分区与线路切换
|
// 由子组件控制的分区与线路切换
|
||||||
const changeArea = (result: any) => {
|
const changeArea = (result: any) => {
|
||||||
console.log(result,'changeArea')
|
console.log(result, 'changeArea');
|
||||||
// 数组
|
// 数组
|
||||||
if (Array.isArray(result)) {
|
if (Array.isArray(result)) {
|
||||||
area.value = result
|
area.value = result;
|
||||||
// 不是数组
|
// 不是数组
|
||||||
} else {
|
} else {
|
||||||
area.value.length = 0
|
area.value.length = 0;
|
||||||
area.value[0] = String(result)
|
area.value[0] = String(result);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
// 由当前组件控制的分区切换
|
// 由当前组件控制的分区切换
|
||||||
const changeThisArea = (result: any) => {
|
const changeThisArea = (result: any) => {
|
||||||
tabs1Ref.value.changeCancel()
|
console.log(result, 'changeThisArea');
|
||||||
console.log(result, 'changeThisArea')
|
|
||||||
// 修改前,将所有选项置空
|
// 修改前,将所有选项置空
|
||||||
reset()
|
reset();
|
||||||
let level1 = result[0];
|
let level1 = result[0];
|
||||||
area.value.length = 0
|
area.value.length = 0;
|
||||||
|
// 只选择了分区
|
||||||
if (result.length === 1) {
|
if (result.length === 1) {
|
||||||
result[0].selected = true
|
result[0].selected = true;
|
||||||
area.value.push(result[0].id)
|
area.value.push(result[0].id);
|
||||||
|
// 控制子组件按钮区
|
||||||
|
tabs1Ref.value.changeArea(result[0]);
|
||||||
|
// 选择了分区 + 线路
|
||||||
} else if (result.length === 2) {
|
} else if (result.length === 2) {
|
||||||
// 如果没有分区,默认选择第一个
|
// 如果没有分区,默认选择第一个
|
||||||
if (!level1) {
|
if (!level1) {
|
||||||
level1 = treeData.value[0]
|
level1 = treeData.value[0];
|
||||||
}
|
}
|
||||||
// 选中状态都设为true
|
// 选中状态都设为true
|
||||||
level1.selected = result[1].selected = true
|
level1.selected = result[1].selected = true;
|
||||||
area.value.splice(0, 0, level1.id, result[1].id)
|
area.value.splice(0, 0, level1.id, result[1].id);
|
||||||
|
// 控制子组件按钮区
|
||||||
|
tabs1Ref.value.changeArea(result[0]);
|
||||||
|
tabs1Ref.value.changeLine(result[1]);
|
||||||
}
|
}
|
||||||
nowArea.value = level1.id
|
};
|
||||||
}
|
// 重置分区树所有当前选项
|
||||||
// 重置分区树所有当前选项
|
const reset = () => {
|
||||||
const reset = () => {
|
|
||||||
treeData.value.forEach((item: any) => {
|
treeData.value.forEach((item: any) => {
|
||||||
item.selected = false
|
item.selected = false;
|
||||||
item.childList.forEach((i: any) => {
|
item.childList.forEach((i: any) => {
|
||||||
i.selected = false
|
i.selected = false;
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
// 俯视图分区选中计算函数
|
// 俯视图分区选中计算函数
|
||||||
const computedClass = (string: string) => {
|
const computedClass = (string: string) => {
|
||||||
if (area.value.indexOf(string) != -1) {
|
if (area.value.indexOf(string) != -1) {
|
||||||
return `isActive area-item area${string}`
|
return `isActive area-item area${string}`;
|
||||||
} else {
|
} else {
|
||||||
return `area-item area${string}`
|
return `area-item area${string}`;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
const getAllArea = () => {
|
// 获得所有分区
|
||||||
http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then(res => {
|
const getAllArea = () => {
|
||||||
const data = res.data
|
http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then((res) => {
|
||||||
floorData.value = data
|
const data = res.data;
|
||||||
/** 只在前端使用的变量
|
floorData.value = data;
|
||||||
* @param id 用于判断样式和层级的前端属性
|
/** 只在前端使用的变量
|
||||||
* @param selected 用于表示是否选中的前端属性
|
* @param id 用于判断样式和层级的前端属性
|
||||||
*/
|
* @param selected 用于表示是否选中的前端属性
|
||||||
data.forEach((floor: any) => {
|
*/
|
||||||
floor.childList.forEach((item: any, index: number) => {
|
data.forEach((floor: any) => {
|
||||||
if (index == 0) {
|
floor.childList.forEach((item: any, index: number) => {
|
||||||
item.selected = true
|
if (index == 0) {
|
||||||
} else {
|
item.selected = true;
|
||||||
item.selected = false
|
} else {
|
||||||
}
|
item.selected = false;
|
||||||
item.id = String(index + 1)
|
}
|
||||||
item.childList.forEach((v: any, i: number) => {
|
item.id = String(index + 1);
|
||||||
v.selected = false
|
item.childList.forEach((v: any, i: number) => {
|
||||||
v.id = (index + 1) + '-' + (i + 1)
|
v.selected = false;
|
||||||
})
|
v.id = index + 1 + '-' + (i + 1);
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
treeData.value = data[0].childList
|
});
|
||||||
})
|
// 默认展示 线路 1-1
|
||||||
}
|
treeData.value = data[0].childList;
|
||||||
|
// 开始预加载
|
||||||
|
preload.value = true;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 抽屉业务 =====================================================
|
// 抽屉业务 =====================================================
|
||||||
|
|
||||||
// 抽屉 - 当前选择的tab
|
// 抽屉 - 当前选择的tab
|
||||||
let activeKey = ref('1');
|
let activeKey = ref('1');
|
||||||
// 抽屉 - 打开状态
|
// 抽屉 - 打开状态
|
||||||
let visible = ref(false);
|
let visible = ref(false);
|
||||||
// 抽屉 - 开关事件
|
// 抽屉 - 开关事件
|
||||||
const toggleDrawer = () => {
|
const toggleDrawer = () => {
|
||||||
visible.value = !visible.value;
|
visible.value = !visible.value;
|
||||||
};
|
};
|
||||||
const tabs1Ref = ref()
|
// 抽屉tab1组件的引用
|
||||||
|
const tabs1Ref = ref();
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@import "./index.less";
|
@import './index.less';
|
||||||
// 当前选中分区的样式
|
|
||||||
.isActive {
|
// 当前选中分区的样式
|
||||||
|
.isActive {
|
||||||
border: 3px solid white !important;
|
border: 3px solid white !important;
|
||||||
}
|
}
|
||||||
// 抽屉顶部tab按钮样式
|
|
||||||
:deep(.ant-tabs-tab-btn) {
|
// 抽屉顶部tab按钮样式
|
||||||
|
:deep(.ant-tabs-tab-btn) {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -1,59 +1,59 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-popover color="rgba(0, 0, 0, 0.8)">
|
<a-popover color="rgba(0, 0, 0, 0.8)">
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="light-tag">
|
<div class="light-tag">
|
||||||
<div class="light-tag-tit">
|
<div class="light-tag-tit">
|
||||||
<div>
|
<div>
|
||||||
<img src="/asset/image//bulbLogo/21962.png" alt="" />
|
<img src="/asset/image//bulbLogo/21962.png" alt="" />
|
||||||
<span class="tag-text">{{ result.name }}</span>
|
<span class="tag-text">{{ result.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<button class="right-button">{{ type == 1 ? '正常' : '关闭' }}</button>
|
<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" v-show="visible">
|
|
||||||
<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>
|
</div>
|
||||||
</a-popover>
|
<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" v-show="visible">
|
||||||
|
<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>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
defineProps({
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
defineProps({
|
||||||
styleObject: Object,
|
styleObject: Object,
|
||||||
type: Number,
|
type: Number,
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const result = ref({
|
const result = ref({
|
||||||
id: '1',
|
id: '1',
|
||||||
name: '站厅照明 1区',
|
name: '站厅照明 1区',
|
||||||
manual: '手动',
|
manual: '手动',
|
||||||
@@ -64,77 +64,86 @@ const result = ref({
|
|||||||
automatic2: '舒适',
|
automatic2: '舒适',
|
||||||
brightness3: '4000k',
|
brightness3: '4000k',
|
||||||
brightness4: '3800k',
|
brightness4: '3800k',
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.icon-box {
|
.icon-box {
|
||||||
width: 25px;
|
width: 25px;
|
||||||
height: 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;
|
position: absolute;
|
||||||
.icon-item {
|
left: 60px;
|
||||||
width: 25px;
|
top: 13px;
|
||||||
cursor: pointer;
|
color: rgba(64, 255, 252, 1);
|
||||||
transition: all ease 0.1s;
|
}
|
||||||
}
|
|
||||||
.icon-item:active {
|
.result {
|
||||||
transform: scale(1.2);
|
line-height: 50px;
|
||||||
}
|
font-size: 16px;
|
||||||
}
|
font-weight: 700;
|
||||||
// 悬浮窗外部
|
color: white;
|
||||||
.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>
|
</style>
|
||||||
|
|
||||||
@@ -5,15 +5,21 @@
|
|||||||
<div class="light-area">
|
<div class="light-area">
|
||||||
<div class="light-area-tab"></div>
|
<div class="light-area-tab"></div>
|
||||||
<span class="light-area-text"> 照明区域 </span>
|
<span class="light-area-text"> 照明区域 </span>
|
||||||
<button class="plan" :class="{ enabled: isPlanEnabled, disabled: !isPlanEnabled }" @click="togglePlan">
|
<button
|
||||||
|
class="plan"
|
||||||
|
:class="{ enabled: isPlanEnabled, disabled: !isPlanEnabled }"
|
||||||
|
@click="togglePlan">
|
||||||
{{ isPlanEnabled ? '计划启用' : '计划禁用' }}
|
{{ isPlanEnabled ? '计划启用' : '计划禁用' }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- 照明区域按钮部分 -->
|
<!-- 照明区域按钮部分 -->
|
||||||
<div class="area">
|
<div class="area">
|
||||||
<template v-if="!showAllButtonsArea">
|
<template v-if="!showAllButtonsArea">
|
||||||
<button v-for="(button, index) in limitedButtons1" :key="index"
|
<button
|
||||||
:class="{ btn: true, selected: button.selected }" @click="selectButton(button)">
|
v-for="(button, index) in limitedButtons1"
|
||||||
|
:key="index"
|
||||||
|
:class="{ btn: true, selected: button.selected }"
|
||||||
|
@click="changeArea(button)">
|
||||||
{{ button.name }}
|
{{ button.name }}
|
||||||
</button>
|
</button>
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
@@ -21,8 +27,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<button v-for="(button, index) in props.treeData" :key="index" :class="{ btn: true, selected: button.selected }"
|
<button
|
||||||
@click="selectButton(button)">
|
v-for="(button, index) in props.treeData"
|
||||||
|
:key="index"
|
||||||
|
:class="{ btn: true, selected: button.selected }"
|
||||||
|
@click="changeArea(button)">
|
||||||
{{ button.name }}
|
{{ button.name }}
|
||||||
</button>
|
</button>
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
@@ -37,13 +46,20 @@
|
|||||||
<div class="circuit-tab"></div>
|
<div class="circuit-tab"></div>
|
||||||
<span class="circuit-text">照明回路</span>
|
<span class="circuit-text">照明回路</span>
|
||||||
<div class="btn2">
|
<div class="btn2">
|
||||||
<button class="openPlan" :class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }" @click="togglePlan2">
|
<button
|
||||||
|
class="openPlan"
|
||||||
|
:class="{ enabled2: isPlanEnabled2, disabled2: !isPlanEnabled2 }"
|
||||||
|
@click="togglePlan2">
|
||||||
{{ isPlanEnabled2 ? '启用面板' : '禁用面板' }}
|
{{ isPlanEnabled2 ? '启用面板' : '禁用面板' }}
|
||||||
</button>
|
</button>
|
||||||
<a-switch v-model:checked="selectAllCheckbox" :disabled="singleSelection" :class="{
|
<a-switch
|
||||||
'blue-background': selectAllCheckbox,
|
v-model:checked="selectAllCheckbox"
|
||||||
'grey-background': !selectAllCheckbox,
|
:disabled="singleSelection"
|
||||||
}" @change="toggleAllSelection" />
|
:class="{
|
||||||
|
'blue-background': selectAllCheckbox,
|
||||||
|
'grey-background': !selectAllCheckbox,
|
||||||
|
}"
|
||||||
|
@change="toggleAllSelection" />
|
||||||
<button class="allBtn">全选</button>
|
<button class="allBtn">全选</button>
|
||||||
<button class="both" @click="selectAll">
|
<button class="both" @click="selectAll">
|
||||||
{{ singleSelection ? '多选' : '单选' }}
|
{{ singleSelection ? '多选' : '单选' }}
|
||||||
@@ -52,8 +68,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="btnArea">
|
<div class="btnArea">
|
||||||
<template v-if="!showAllButtons">
|
<template v-if="!showAllButtons">
|
||||||
<button v-for="(button, index) in limitedButtons2" :key="index"
|
<button
|
||||||
:class="{ btn: true, selected: button.selected }" class="zmhlbtn" @click="toggleSelection(button)">
|
v-for="(button, index) in limitedButtons2"
|
||||||
|
:key="index"
|
||||||
|
:class="{ btn: true, selected: button.selected }"
|
||||||
|
class="zmhlbtn"
|
||||||
|
@click="changeLine(button)">
|
||||||
<stop-outlined v-if="button.ctrlStatus" />
|
<stop-outlined v-if="button.ctrlStatus" />
|
||||||
{{ button.name }}
|
{{ button.name }}
|
||||||
</button>
|
</button>
|
||||||
@@ -62,8 +82,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<button v-for="(button, index) in buttons2" :key="index"
|
<button
|
||||||
:class="{ btn: true, selected: button.selected }" class="zmhlbtn" @click="toggleSelection(button)">
|
v-for="(button, index) in buttons2"
|
||||||
|
:key="index"
|
||||||
|
:class="{ btn: true, selected: button.selected }"
|
||||||
|
class="zmhlbtn"
|
||||||
|
@click="changeLine(button)">
|
||||||
<stop-outlined v-if="button.ctrlStatus" />
|
<stop-outlined v-if="button.ctrlStatus" />
|
||||||
{{ button.name }}
|
{{ button.name }}
|
||||||
</button>
|
</button>
|
||||||
@@ -81,37 +105,42 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 控制模式按钮部分 -->
|
<!-- 控制模式按钮部分 -->
|
||||||
<div class="control-mode-btn-area" v-show="thisButton2.code">
|
<div class="control-mode-btn-area" v-show="thisButton2.code">
|
||||||
<button v-for="(button3, index) in controlMode" :key="index"
|
<button
|
||||||
class="btn"
|
v-for="(button3, index) in controlMode"
|
||||||
:disabled="button3.value!= 3"
|
:key="index"
|
||||||
:class="{ selected: thisButton2.mode.value == button3.value }" @click="selectButton3(button3)">
|
class="btn"
|
||||||
|
:disabled="button3.value != 3"
|
||||||
|
:class="{ selected: thisButton2.mode.value == button3.value }"
|
||||||
|
@click="selectButton3(button3)">
|
||||||
{{ button3.label }}
|
{{ button3.label }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 控制场景部分 -->
|
<!-- 控制场景部分 -->
|
||||||
<div>
|
<div>
|
||||||
<div class="control-scene-area" v-show="thisButton2.mode.value == '3'">
|
<div class="control-scene-area" v-show="thisButton2.mode.value == 3">
|
||||||
<div class="control-scene-tab"></div>
|
<div class="control-scene-tab"></div>
|
||||||
<span class="control-scene-text"> 控制场景 </span>
|
<span class="control-scene-text"> 控制场景 </span>
|
||||||
</div>
|
</div>
|
||||||
<!-- 控制场景按钮部分 -->
|
<!-- 控制场景按钮部分 -->
|
||||||
<div class="control-scene-btn-area" v-show="thisButton2.mode.value == '3'">
|
<div class="control-scene-btn-area" v-show="thisButton2.mode.value == 3">
|
||||||
<button v-for="(button4, index) in controlScene" :key="index"
|
<button
|
||||||
:class="{ btn: true, selected: thisButton2.mode.value == button4.value }" @click="selectButton4(button4)">
|
v-for="(button4, index) in controlScene"
|
||||||
|
:key="index"
|
||||||
|
:class="{ btn: true, selected: thisButton2.scene.value == button4.value }"
|
||||||
|
@click="selectButton4(button4)">
|
||||||
{{ button4.label }}
|
{{ button4.label }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 底部按钮区 -->
|
<!-- 底部按钮区 -->
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="刷新将会取消已作出的修改"
|
title="刷新将会取消已作出的修改"
|
||||||
ok-text="确定"
|
ok-text="确定"
|
||||||
cancel-text="取消"
|
cancel-text="取消"
|
||||||
@confirm="changeConfirm"
|
@confirm="changeConfirm"
|
||||||
@cancel="changeCancel"
|
@cancel="changeCancel">
|
||||||
>
|
|
||||||
<button class="flushed">刷新</button>
|
<button class="flushed">刷新</button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
<button class="execute" @click="showModal">执行</button>
|
<button class="execute" @click="showModal">执行</button>
|
||||||
@@ -129,7 +158,11 @@
|
|||||||
<div class="imgText">
|
<div class="imgText">
|
||||||
<div class="zjzm">
|
<div class="zjzm">
|
||||||
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />
|
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />
|
||||||
<span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ item.name }}</span>
|
<span
|
||||||
|
class="title-text"
|
||||||
|
style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)"
|
||||||
|
>{{ item.name }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<button class="cxbtn" @click="delBtn(item.id)">撤销</button>
|
<button class="cxbtn" @click="delBtn(item.id)">撤销</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -143,9 +176,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-item">
|
<div class="btn-item">
|
||||||
<div class="left">
|
<div class="left"> 亮度 </div>
|
||||||
亮度
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<span>100lux</span>
|
<span>100lux</span>
|
||||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||||
@@ -153,9 +184,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-item">
|
<div class="btn-item">
|
||||||
<div class="left">
|
<div class="left"> 控制场景 </div>
|
||||||
控制场景
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<span>手动</span>
|
<span>手动</span>
|
||||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||||
@@ -163,9 +192,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-item">
|
<div class="btn-item">
|
||||||
<div class="left">
|
<div class="left"> 色温 </div>
|
||||||
色温
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<span>4000k</span>
|
<span>4000k</span>
|
||||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||||
@@ -176,7 +203,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100%; height: 60px;"></div>
|
<div style="width: 100%; height: 60px"></div>
|
||||||
<div class="button-box">
|
<div class="button-box">
|
||||||
<button class="cancel" @click="executeVisible = false">取消</button>
|
<button class="cancel" @click="executeVisible = false">取消</button>
|
||||||
<button class="execute">执行</button>
|
<button class="execute">执行</button>
|
||||||
@@ -186,380 +213,415 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted, watch } from 'vue';
|
import { ref, computed, onMounted } from 'vue';
|
||||||
import {
|
import { DownOutlined, UpOutlined, StopOutlined } from '@ant-design/icons-vue';
|
||||||
DownOutlined,
|
import { message } from 'ant-design-vue';
|
||||||
UpOutlined,
|
// 请求
|
||||||
StopOutlined,
|
import { http } from '/nerv-lib/util/http';
|
||||||
} from '@ant-design/icons-vue';
|
import { lightingManage } from '/@/api/IlluminationInfo';
|
||||||
import { message } from 'ant-design-vue';
|
import { getAllEnum } from '/@/api/index';
|
||||||
// 请求
|
|
||||||
import { http } from '/nerv-lib/util/http';
|
|
||||||
import { lightingManage } from '/@/api/IlluminationInfo';
|
|
||||||
import { getAllEnum } from '/@/api/index'
|
|
||||||
|
|
||||||
// 初始化 =========================================================================
|
// 初始化 =========================================================================
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 设置分区
|
// 默认选项
|
||||||
setArea(0)
|
setArea();
|
||||||
// 获得枚举
|
// 获得枚举
|
||||||
getEnum(['IlluminationMode', 'IlluminationScene'])
|
getEnum(['IlluminationMode', 'IlluminationScene']);
|
||||||
})
|
|
||||||
|
|
||||||
// 获得枚举,初始化
|
|
||||||
const getEnum = (arr: any) => {
|
|
||||||
getAllEnum({ params: arr }).then(res => {
|
|
||||||
const data = res.data
|
|
||||||
controlMode.value = data.IlluminationMode
|
|
||||||
controlScene.value = data.IlluminationScene
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 父组件点击俯视图切换分区时,子组件切换线路
|
|
||||||
const setArea = (isHandle: number) => {
|
|
||||||
const data = props.treeData.find((item: any) => {
|
|
||||||
return item.id == props.nowArea
|
|
||||||
})
|
|
||||||
// 默认选中第一个分区
|
|
||||||
data.selected = true
|
|
||||||
// 修改当前选中的分区
|
|
||||||
selectedButton.value = props.nowArea
|
|
||||||
// 设置当前显示的回路
|
|
||||||
buttons2.value = data.childList
|
|
||||||
|
|
||||||
// 如果非初始化触发(点击俯视图)
|
|
||||||
if (isHandle) {
|
|
||||||
// 如果选中了线路则children中的某个selected为true
|
|
||||||
const button2 = data.childList.find((item: any) => {
|
|
||||||
return item.selected == true
|
|
||||||
})
|
|
||||||
// 如果选中了线路
|
|
||||||
if (button2) {
|
|
||||||
thisButton2.value = button2;
|
|
||||||
console.log(button2,'2222222222')
|
|
||||||
|
|
||||||
} else {
|
|
||||||
resetMode()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 与父组件的交互 ===================================================================
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
// 分区结构(照明区域 > 照明回路)
|
|
||||||
treeData: {
|
|
||||||
type: Array,
|
|
||||||
default: []
|
|
||||||
},
|
|
||||||
// 父组件选中的分区ID
|
|
||||||
nowArea: {
|
|
||||||
type: String,
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 向上传递修改选择样式
|
|
||||||
/**
|
|
||||||
* @method changeArea 用于控制俯视图的选中状态
|
|
||||||
* @method reset 用于重置按钮区
|
|
||||||
*/
|
|
||||||
const emit = defineEmits(['changeArea','reset']);
|
|
||||||
// 监听父组件选中的分区,并实时修改分区
|
|
||||||
watch(() => props.nowArea, () => {
|
|
||||||
setArea(1)
|
|
||||||
// 分区产生了切换, 线路的选中状态置空
|
|
||||||
handleButton.value = ''
|
|
||||||
})
|
|
||||||
|
|
||||||
// 照明区域业务 =======================================================================
|
|
||||||
|
|
||||||
// 计划启用状态
|
|
||||||
const isPlanEnabled = ref(false);
|
|
||||||
// 计划启用切换事件
|
|
||||||
const togglePlan = () => {
|
|
||||||
isPlanEnabled.value = !isPlanEnabled.value;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 按钮区展开与收起状态
|
|
||||||
const showAllButtonsArea = ref(false);
|
|
||||||
// 被选中的分区 默认为1
|
|
||||||
const selectedButton = ref<string | undefined>('1');
|
|
||||||
// 区域切换(按钮点击-单选)事件
|
|
||||||
const selectButton = (button: any) => {
|
|
||||||
// 当前选中按钮
|
|
||||||
selectedButton.value = button.id;
|
|
||||||
initMenu(1)
|
|
||||||
button.selected = true
|
|
||||||
buttons2.value = button.childList
|
|
||||||
emit('changeArea', button.id);
|
|
||||||
resetMode()
|
|
||||||
handleButton.value = ''
|
|
||||||
};
|
|
||||||
// 默认最多展示8个按钮
|
|
||||||
const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
|
|
||||||
|
|
||||||
// 照明回路业务 ======================================================================
|
|
||||||
|
|
||||||
// 最近交互过的按钮id,用于禁用和启用
|
|
||||||
const handleButton = ref('');
|
|
||||||
|
|
||||||
// 面板启用/禁用状态
|
|
||||||
const isPlanEnabled2 = ref(true);
|
|
||||||
// 面板启用/禁用切换事件
|
|
||||||
const togglePlan2 = () => {
|
|
||||||
// 如果未交互任何按钮
|
|
||||||
if (handleButton.value == '') {
|
|
||||||
return message.info('请选择照明回路');
|
|
||||||
}
|
|
||||||
// 获取最近交互过的按钮
|
|
||||||
const btn: any = buttons2.value.find((button) => button.id === handleButton.value)
|
|
||||||
let panel = +(!btn.ctrlStatus)
|
|
||||||
isLoading.value = true
|
|
||||||
http.get(lightingManage.setDisable, { deviceGroup: btn.code, panel }).then(res => {
|
|
||||||
if (res.msg === 'success') {
|
|
||||||
// 确认成功后 - 按钮文本取反 - 按钮布尔值修改 - 关闭loading
|
|
||||||
isPlanEnabled2.value = !isPlanEnabled2.value;
|
|
||||||
btn.ctrlStatus = panel
|
|
||||||
isLoading.value = false
|
|
||||||
} else {
|
|
||||||
isLoading.value = false
|
|
||||||
}
|
|
||||||
}).catch(() => { isLoading.value = false })
|
|
||||||
};
|
|
||||||
|
|
||||||
// 是否单选,状态
|
|
||||||
let singleSelection = ref(true);
|
|
||||||
// 多选与单选切换事件
|
|
||||||
const selectAll = () => {
|
|
||||||
selectAllCheckbox.value = false
|
|
||||||
buttons2.value.forEach((button) => {
|
|
||||||
button.selected = false;
|
|
||||||
});
|
});
|
||||||
singleSelection.value = !singleSelection.value;
|
// 获得枚举
|
||||||
resetMode()
|
const getEnum = (arr: any) => {
|
||||||
emit('changeArea', [selectedButton.value])
|
getAllEnum({ params: arr }).then((res) => {
|
||||||
};
|
const data = res.data;
|
||||||
|
// 控制模式
|
||||||
// 全选状态
|
controlMode.value = data.IlluminationMode;
|
||||||
const selectAllCheckbox = ref(false);
|
// 控制场景
|
||||||
// 全选切换事件(switch)
|
controlScene.value = data.IlluminationScene;
|
||||||
const toggleAllSelection = () => {
|
|
||||||
let arr = [selectedButton.value]
|
|
||||||
// 全选
|
|
||||||
if (selectAllCheckbox.value) {
|
|
||||||
buttons2.value.forEach((item) => {
|
|
||||||
item.selected = true;
|
|
||||||
arr.push(item.id)
|
|
||||||
});
|
});
|
||||||
// 全不选
|
};
|
||||||
} else {
|
// 以 1-1 作为默认线路
|
||||||
buttons2.value.forEach((item) => {
|
const setArea = () => {
|
||||||
item.selected = false;
|
const data = props.treeData[0];
|
||||||
|
buttons2.value = data.childList;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 与父组件的交互 ===================================================================
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
// 分区结构(照明区域 > 照明回路)
|
||||||
|
treeData: {
|
||||||
|
type: Array,
|
||||||
|
default: [],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// 向上传递修改选择样式
|
||||||
|
/**
|
||||||
|
* @method changeArea 用于控制俯视图的选中状态
|
||||||
|
* @method reset 用于重置按钮区
|
||||||
|
*/
|
||||||
|
const emit = defineEmits(['changeArea', 'reset']);
|
||||||
|
|
||||||
|
// 照明区域业务 =======================================================================
|
||||||
|
|
||||||
|
// 计划启用状态
|
||||||
|
const isPlanEnabled = ref(false);
|
||||||
|
// 计划启用切换事件
|
||||||
|
const togglePlan = () => {
|
||||||
|
isPlanEnabled.value = !isPlanEnabled.value;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 按钮区展开与收起状态
|
||||||
|
const showAllButtonsArea = ref(false);
|
||||||
|
// 被选中的分区 默认为1
|
||||||
|
const selectedButton = ref<string | undefined>('1');
|
||||||
|
|
||||||
|
// 分区切换
|
||||||
|
const changeArea = (button: any) => {
|
||||||
|
// 当前选中按钮
|
||||||
|
selectedButton.value = button.id;
|
||||||
|
// 设置当前选中的线路
|
||||||
|
buttons2.value = button.childList;
|
||||||
|
// 重置按钮状态
|
||||||
|
emit('reset');
|
||||||
|
// 设置选中按钮状态
|
||||||
|
button.selected = true;
|
||||||
|
// 改变俯视图样式
|
||||||
|
emit('changeArea', button.id);
|
||||||
|
// 当前选中线路 - 置空
|
||||||
|
resetMode();
|
||||||
|
// 最近交互过的按钮 - 置空
|
||||||
|
handleButton.value = '';
|
||||||
|
};
|
||||||
|
// 默认最多展示8个按钮
|
||||||
|
const limitedButtons1 = computed(() => props.treeData.slice(0, 8));
|
||||||
|
|
||||||
|
// 照明回路业务 ======================================================================
|
||||||
|
|
||||||
|
// 最近交互过的按钮id,用于禁用和启用
|
||||||
|
const handleButton = ref('');
|
||||||
|
|
||||||
|
// 面板启用/禁用状态
|
||||||
|
const isPlanEnabled2 = ref(true);
|
||||||
|
// 面板启用/禁用切换事件
|
||||||
|
const togglePlan2 = () => {
|
||||||
|
// 如果未交互任何按钮
|
||||||
|
if (handleButton.value == '') {
|
||||||
|
return message.info('请选择照明回路');
|
||||||
|
}
|
||||||
|
// 获取最近交互过的按钮
|
||||||
|
const btn: any = buttons2.value.find((button) => button.id === handleButton.value);
|
||||||
|
let panel = +!btn.ctrlStatus;
|
||||||
|
isLoading.value = true;
|
||||||
|
http
|
||||||
|
.get(lightingManage.setDisable, { deviceGroup: btn.code, panel })
|
||||||
|
.then((res) => {
|
||||||
|
if (res.msg === 'success') {
|
||||||
|
// 确认成功后 - 按钮文本取反 - 按钮布尔值修改 - 关闭loading
|
||||||
|
isPlanEnabled2.value = !isPlanEnabled2.value;
|
||||||
|
btn.ctrlStatus = panel;
|
||||||
|
isLoading.value = false;
|
||||||
|
} else {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
isLoading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 是否单选,状态
|
||||||
|
let singleSelection = ref(true);
|
||||||
|
// 多选与单选切换事件
|
||||||
|
const selectAll = () => {
|
||||||
|
selectAllCheckbox.value = false;
|
||||||
|
buttons2.value.forEach((button) => {
|
||||||
|
button.selected = false;
|
||||||
});
|
});
|
||||||
}
|
singleSelection.value = !singleSelection.value;
|
||||||
emit('changeArea', arr)
|
// 当前选中线路 - 置空
|
||||||
};
|
resetMode();
|
||||||
|
// 改变俯视图样式
|
||||||
|
emit('changeArea', [selectedButton.value]);
|
||||||
|
};
|
||||||
|
|
||||||
// 照明回路的按钮切换
|
// 全选状态
|
||||||
const toggleSelection = (button: any) => {
|
const selectAllCheckbox = ref(false);
|
||||||
// 存储一次按钮ID,用于禁用/启用交互
|
// 全选切换事件(switch)
|
||||||
handleButton.value = button.id
|
const toggleAllSelection = () => {
|
||||||
// 根据按钮状态,展示禁用/启用按钮文本
|
let arr = [selectedButton.value];
|
||||||
if (button.ctrlStatus) {
|
// 全选
|
||||||
isPlanEnabled2.value = true
|
if (selectAllCheckbox.value) {
|
||||||
} else {
|
buttons2.value.forEach((item, index) => {
|
||||||
isPlanEnabled2.value = false
|
// 全选时,默认展示第一条线路的模式-场景按钮
|
||||||
}
|
if (index == 0) {
|
||||||
|
thisButton2.value = item;
|
||||||
|
}
|
||||||
|
item.selected = true;
|
||||||
|
arr.push(item.id);
|
||||||
|
});
|
||||||
|
// 全不选
|
||||||
|
} else {
|
||||||
|
buttons2.value.forEach((item) => {
|
||||||
|
item.selected = false;
|
||||||
|
});
|
||||||
|
// 全不选时,隐藏模式-场景按钮
|
||||||
|
resetMode();
|
||||||
|
}
|
||||||
|
emit('changeArea', arr);
|
||||||
|
};
|
||||||
|
|
||||||
// 选择时反控俯视图
|
// 储存当前选中的线路
|
||||||
let level1 = selectedButton.value
|
const thisButton2 = ref({
|
||||||
let level2 = button.id
|
|
||||||
// 单选模式,需将所有按钮设为false
|
|
||||||
if (singleSelection.value) {
|
|
||||||
buttons2.value.forEach(item => {
|
|
||||||
item.selected = false;
|
|
||||||
});
|
|
||||||
emit('changeArea', [level1, level2])
|
|
||||||
button.selected = !button.selected;
|
|
||||||
} else {
|
|
||||||
// 多选模式传值
|
|
||||||
button.selected = !button.selected;
|
|
||||||
const arr = [level1]
|
|
||||||
buttons2.value.forEach(item => {
|
|
||||||
if (item.selected) {
|
|
||||||
arr.push(item.id)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
emit('changeArea', arr)
|
|
||||||
}
|
|
||||||
// 用于展示控制模式
|
|
||||||
if (button.selected) {
|
|
||||||
// 发生了选中事件
|
|
||||||
thisButton2.value = button
|
|
||||||
} else {
|
|
||||||
// 未发生选中 或 多选被取消
|
|
||||||
resetMode()
|
|
||||||
}
|
|
||||||
console.log(thisButton2,'button')
|
|
||||||
};
|
|
||||||
|
|
||||||
// 照明回路所有按钮
|
|
||||||
const buttons2 = ref([]);
|
|
||||||
// 按钮区展开与收起状态
|
|
||||||
const showAllButtons = ref(false);
|
|
||||||
// 默认最多展示8个按钮
|
|
||||||
const limitedButtons2 = computed(() => buttons2.value.slice(0, 8));
|
|
||||||
|
|
||||||
// 控制模式业务 ====================================================================
|
|
||||||
|
|
||||||
const thisButton2 = ref({
|
|
||||||
code: '',
|
|
||||||
mode: {
|
|
||||||
value: '0'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 控制模式 - 按钮切换
|
|
||||||
const selectButton3 = (button3) => {
|
|
||||||
let checked = thisButton2.value.mode
|
|
||||||
console.log(button3.value,'---', checked.value)
|
|
||||||
// 如果点击了相同的按钮,未作出修改
|
|
||||||
if (checked.value === button3.value) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
checked.value = button3.value
|
|
||||||
selectedButton4.value = null; // 清空选中的控制场景按钮
|
|
||||||
};
|
|
||||||
|
|
||||||
const diff = () => {
|
|
||||||
console.log(thisButton2)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 控制场景业务 =====================================================================
|
|
||||||
|
|
||||||
// 控制模式枚举
|
|
||||||
const controlMode = ref([])
|
|
||||||
// 场景枚举
|
|
||||||
const controlScene = ref([])
|
|
||||||
// 控制场景 - 当前选择按钮
|
|
||||||
const selectedButton4 = ref(null);
|
|
||||||
// 控制场景 - 按钮切换
|
|
||||||
const selectButton4 = (button4) => {
|
|
||||||
selectedButton4.value = button4.label;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 内侧弹窗 ========================================================================
|
|
||||||
|
|
||||||
// 需要向后端提交的修改内容
|
|
||||||
const submitArray = ref([])
|
|
||||||
const cxList = ref([
|
|
||||||
{
|
|
||||||
id: '1',
|
|
||||||
name: '站厅照明 1区',
|
|
||||||
manual: '手动',
|
|
||||||
automatic: '自动',
|
|
||||||
brightness: '100lux',
|
|
||||||
brightness2: '30lux',
|
|
||||||
manual2: '手动',
|
|
||||||
automatic2: '自动',
|
|
||||||
brightness3: '4000k',
|
|
||||||
brightness4: '3800k',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '2',
|
|
||||||
name: '站厅照明 2区',
|
|
||||||
manual: '手动',
|
|
||||||
automatic: '自动',
|
|
||||||
brightness: '100lux',
|
|
||||||
brightness2: '30lux',
|
|
||||||
manual2: '手动',
|
|
||||||
automatic2: '自动',
|
|
||||||
brightness3: '4000k',
|
|
||||||
brightness4: '3800k',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '3',
|
|
||||||
name: '站厅照明 3区',
|
|
||||||
manual: '手动',
|
|
||||||
automatic: '自动',
|
|
||||||
brightness: '100lux',
|
|
||||||
brightness2: '30lux',
|
|
||||||
manual2: '手动',
|
|
||||||
automatic2: '自动',
|
|
||||||
brightness3: '4000k',
|
|
||||||
brightness4: '3800k',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
//撤销
|
|
||||||
const delBtn = (id: any) => {
|
|
||||||
cxList.value.pop();
|
|
||||||
console.log(cxList.value.length);
|
|
||||||
|
|
||||||
if (cxList.value.length === 0) {
|
|
||||||
executeVisible.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 其他业务 ========================================================================
|
|
||||||
|
|
||||||
const isLoading = ref(false)
|
|
||||||
|
|
||||||
// 用于初始化5级联动的菜单
|
|
||||||
const initMenu = (tier: number) => {
|
|
||||||
// 1 = 照明区域 - 切换时,重置以下所有菜单
|
|
||||||
if (tier == 1) {
|
|
||||||
emit('reset')
|
|
||||||
// 灯具参数 隐藏
|
|
||||||
selectedButton4.value = null;
|
|
||||||
} else if (tier == 2) {
|
|
||||||
// 灯具参数 隐藏
|
|
||||||
selectedButton4.value = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 刷新
|
|
||||||
const refresh = () => {
|
|
||||||
// 关闭执行弹窗
|
|
||||||
executeVisible.value = false
|
|
||||||
// 设置当前选中的序列
|
|
||||||
selectedButton.value = '1';
|
|
||||||
emit('changeArea', ['1']);
|
|
||||||
emit('reset')
|
|
||||||
let data = props.treeData[0]
|
|
||||||
// 默认选中
|
|
||||||
data.selected = true
|
|
||||||
buttons2.value = data.childList
|
|
||||||
selectedButton4.value = null;
|
|
||||||
resetMode()
|
|
||||||
};
|
|
||||||
// 执行确认
|
|
||||||
const executeVisible = ref<boolean>(false);
|
|
||||||
const showModal = () => {
|
|
||||||
executeVisible.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
// 确定
|
|
||||||
const changeConfirm = () => {
|
|
||||||
refresh()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 取消
|
|
||||||
const changeCancel = () => {
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将当前选择的线路置空
|
|
||||||
const resetMode = () => {
|
|
||||||
thisButton2.value = {
|
|
||||||
code: '',
|
code: '',
|
||||||
mode: {
|
mode: {
|
||||||
value: '0'
|
value: -1,
|
||||||
|
},
|
||||||
|
scene: {
|
||||||
|
value: -1,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// 照明回路的按钮切换
|
||||||
|
const changeLine = (button: any) => {
|
||||||
|
// 存储一次按钮ID,用于禁用/启用交互
|
||||||
|
handleButton.value = button.id;
|
||||||
|
// 根据按钮状态,展示禁用/启用按钮文本
|
||||||
|
if (button.ctrlStatus) {
|
||||||
|
isPlanEnabled2.value = true;
|
||||||
|
} else {
|
||||||
|
isPlanEnabled2.value = false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
// 选择时反控俯视图
|
||||||
changeCancel
|
let level1 = selectedButton.value;
|
||||||
});
|
let level2 = button.id;
|
||||||
|
// 单选模式,需将所有其他按钮设为false
|
||||||
|
if (singleSelection.value) {
|
||||||
|
buttons2.value.forEach((item) => {
|
||||||
|
item.selected = false;
|
||||||
|
});
|
||||||
|
button.selected = !button.selected;
|
||||||
|
emit('changeArea', [level1, level2]);
|
||||||
|
} else {
|
||||||
|
// 多选模式传值
|
||||||
|
button.selected = !button.selected;
|
||||||
|
const arr = [level1];
|
||||||
|
buttons2.value.forEach((item) => {
|
||||||
|
if (item.selected) {
|
||||||
|
arr.push(item.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
emit('changeArea', arr);
|
||||||
|
}
|
||||||
|
// 用于展示控制模式
|
||||||
|
if (button.selected) {
|
||||||
|
// 发生了选中事件
|
||||||
|
thisButton2.value = button;
|
||||||
|
} else {
|
||||||
|
// 未发生选中 或 多选的其中一个按钮被取消
|
||||||
|
resetMode();
|
||||||
|
}
|
||||||
|
console.log(thisButton2, 'button');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 照明回路所有按钮
|
||||||
|
const buttons2 = ref([]);
|
||||||
|
// 按钮区展开与收起状态
|
||||||
|
const showAllButtons = ref(false);
|
||||||
|
// 默认最多展示8个按钮
|
||||||
|
const limitedButtons2 = computed(() => buttons2.value.slice(0, 8));
|
||||||
|
|
||||||
|
// 控制模式业务 ====================================================================
|
||||||
|
|
||||||
|
// 控制模式 - 按钮切换
|
||||||
|
const selectButton3 = (button3) => {
|
||||||
|
let checked = thisButton2.value.mode;
|
||||||
|
console.log(button3.value, '---', checked.value);
|
||||||
|
// 如果点击了相同的按钮,则未作出修改
|
||||||
|
if (checked.value === button3.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
checked.value = button3.value;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 控制场景业务 =====================================================================
|
||||||
|
|
||||||
|
// 控制模式枚举
|
||||||
|
const controlMode = ref([]);
|
||||||
|
// 场景枚举
|
||||||
|
const controlScene = ref([]);
|
||||||
|
// 控制场景 - 当前选择按钮
|
||||||
|
const selectedButton4 = ref(null);
|
||||||
|
// 控制场景 - 按钮切换
|
||||||
|
const selectButton4 = (button4) => {
|
||||||
|
// 当前选中的线路数据
|
||||||
|
const data = thisButton2.value;
|
||||||
|
// 修改前的数据
|
||||||
|
let before = data.scene.value;
|
||||||
|
// 修改后的数据
|
||||||
|
let after = button4.value;
|
||||||
|
// 如果没有产生实质性的修改(修改前后相同,则跳出)
|
||||||
|
if (before === after) {
|
||||||
|
return;
|
||||||
|
// 产生了修改
|
||||||
|
} else {
|
||||||
|
thisButton2.value.scene.value = after;
|
||||||
|
// 查询之前是否修改过
|
||||||
|
const result = changeList.value.find((item, index) => {
|
||||||
|
item.index = index;
|
||||||
|
return item.deviceGroup == data.code;
|
||||||
|
});
|
||||||
|
// 如果已产生过修改
|
||||||
|
if (result) {
|
||||||
|
// 改回了原有的值,则从数组中移除
|
||||||
|
if (after == result.before) {
|
||||||
|
changeList.value.splice(result.index, 1);
|
||||||
|
// 修改为新值,则只修改after
|
||||||
|
} else {
|
||||||
|
result.scene = after;
|
||||||
|
// 临时flag,用后移除
|
||||||
|
delete result.index;
|
||||||
|
}
|
||||||
|
// 如果未产生过修改
|
||||||
|
} else {
|
||||||
|
changeList.value.push({
|
||||||
|
// 线路
|
||||||
|
deviceGroup: data.code,
|
||||||
|
deviceGroupName: data.name,
|
||||||
|
// 分区
|
||||||
|
region: data.pcode,
|
||||||
|
regionName: '',
|
||||||
|
// 修改前
|
||||||
|
before: before,
|
||||||
|
// 修改后
|
||||||
|
scene: after,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log(changeList.value, 'changeList');
|
||||||
|
}
|
||||||
|
|
||||||
|
thisButton2.value.scene.value = after;
|
||||||
|
console.log(thisButton2, '222222');
|
||||||
|
console.log(button4, '44444');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 内侧弹窗 ========================================================================
|
||||||
|
|
||||||
|
// 需要修改的内容
|
||||||
|
const changeList: any = ref([]);
|
||||||
|
// 需要向后端提交的修改内容
|
||||||
|
const submitList = ref([]);
|
||||||
|
const cxList = ref([
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: '站厅照明 1区',
|
||||||
|
manual: '手动',
|
||||||
|
automatic: '自动',
|
||||||
|
brightness: '100lux',
|
||||||
|
brightness2: '30lux',
|
||||||
|
manual2: '手动',
|
||||||
|
automatic2: '自动',
|
||||||
|
brightness3: '4000k',
|
||||||
|
brightness4: '3800k',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: '站厅照明 2区',
|
||||||
|
manual: '手动',
|
||||||
|
automatic: '自动',
|
||||||
|
brightness: '100lux',
|
||||||
|
brightness2: '30lux',
|
||||||
|
manual2: '手动',
|
||||||
|
automatic2: '自动',
|
||||||
|
brightness3: '4000k',
|
||||||
|
brightness4: '3800k',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: '站厅照明 3区',
|
||||||
|
manual: '手动',
|
||||||
|
automatic: '自动',
|
||||||
|
brightness: '100lux',
|
||||||
|
brightness2: '30lux',
|
||||||
|
manual2: '手动',
|
||||||
|
automatic2: '自动',
|
||||||
|
brightness3: '4000k',
|
||||||
|
brightness4: '3800k',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
//撤销
|
||||||
|
const delBtn = () => {
|
||||||
|
cxList.value.pop();
|
||||||
|
console.log(cxList.value.length);
|
||||||
|
|
||||||
|
if (cxList.value.length === 0) {
|
||||||
|
executeVisible.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 其他业务 ========================================================================
|
||||||
|
|
||||||
|
const isLoading = ref(false);
|
||||||
|
// 刷新
|
||||||
|
const refresh = () => {
|
||||||
|
// 关闭执行弹窗
|
||||||
|
executeVisible.value = false;
|
||||||
|
// 设置当前选中的序列
|
||||||
|
selectedButton.value = '1';
|
||||||
|
emit('changeArea', ['1']);
|
||||||
|
emit('reset');
|
||||||
|
let data = props.treeData[0];
|
||||||
|
// 默认选中
|
||||||
|
data.selected = true;
|
||||||
|
buttons2.value = data.childList;
|
||||||
|
selectedButton4.value = null;
|
||||||
|
resetMode();
|
||||||
|
};
|
||||||
|
// 执行确认
|
||||||
|
const executeVisible = ref<boolean>(false);
|
||||||
|
const showModal = () => {
|
||||||
|
http
|
||||||
|
.post(lightingManage.getChangeList, { infoList: changeList.value, projectId: 'HLlmTZp8' })
|
||||||
|
.then((res) => {
|
||||||
|
if (res.msg === 'success') {
|
||||||
|
isLoading.value = true;
|
||||||
|
console.log(res);
|
||||||
|
} else {
|
||||||
|
isLoading.value = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
executeVisible.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 确定
|
||||||
|
const changeConfirm = () => {
|
||||||
|
refresh();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 取消
|
||||||
|
const changeCancel = () => {};
|
||||||
|
|
||||||
|
// 将当前选择的线路置空
|
||||||
|
const resetMode = () => {
|
||||||
|
thisButton2.value = {
|
||||||
|
code: '',
|
||||||
|
mode: {
|
||||||
|
value: -1,
|
||||||
|
},
|
||||||
|
scene: {
|
||||||
|
value: -1,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
// 暴露
|
||||||
|
defineExpose({
|
||||||
|
// 分区切换
|
||||||
|
changeArea,
|
||||||
|
// 线路切换
|
||||||
|
changeLine,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@import "./dialogStyle.less";
|
@import './dialogStyle.less';
|
||||||
@import "./tabs1.less";
|
@import './tabs1.less';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
<td v-if="row.planStatus == '2'">
|
<td v-if="row.planStatus == '2'">
|
||||||
<button
|
<button
|
||||||
style="
|
style="
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
background: rgba(57, 215, 187, 0.1);
|
background: rgba(57, 215, 187, 0.1);
|
||||||
color: rgb(57, 215, 187);
|
color: rgb(57, 215, 187);
|
||||||
border: 1px solid rgb(57, 215, 187);
|
border: 1px solid rgb(57, 215, 187);
|
||||||
">
|
">
|
||||||
已执行
|
已执行
|
||||||
</button>
|
</button>
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
<td v-if="row.planStatus == '1'">
|
<td v-if="row.planStatus == '1'">
|
||||||
<button
|
<button
|
||||||
style="
|
style="
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
background: rgba(243, 97, 99, 0.1);
|
background: rgba(243, 97, 99, 0.1);
|
||||||
border: 1px solid rgba(243, 97, 99);
|
border: 1px solid rgba(243, 97, 99);
|
||||||
color: rgba(243, 97, 99);
|
color: rgba(243, 97, 99);
|
||||||
">
|
">
|
||||||
待执行
|
待执行
|
||||||
</button>
|
</button>
|
||||||
@@ -42,11 +42,10 @@
|
|||||||
<td>
|
<td>
|
||||||
<div class="tabReboot" @click="restartPlan(row.id)">重启</div>
|
<div class="tabReboot" @click="restartPlan(row.id)">重启</div>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="此操作将永久删除该条数据"
|
title="此操作将永久删除该条数据"
|
||||||
ok-text="确定"
|
ok-text="确定"
|
||||||
cancel-text="取消"
|
cancel-text="取消"
|
||||||
@confirm="deletePlan(row.id)"
|
@confirm="deletePlan(row.id)">
|
||||||
>
|
|
||||||
<div class="tabDelete">删除</div>
|
<div class="tabDelete">删除</div>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</td>
|
</td>
|
||||||
@@ -70,7 +69,7 @@
|
|||||||
@search="handleSearch"
|
@search="handleSearch"
|
||||||
:listStyle="{ border: '2px solid rgba(25,74,125,1)', height: 'calc(100vh - 200px)' }" />
|
:listStyle="{ border: '2px solid rgba(25,74,125,1)', height: 'calc(100vh - 200px)' }" />
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100%; height: 60px;"></div>
|
<div style="width: 100%; height: 60px"></div>
|
||||||
<div class="button-box">
|
<div class="button-box">
|
||||||
<button class="cancel" @click="addVisible = false">取消</button>
|
<button class="cancel" @click="addVisible = false">取消</button>
|
||||||
<button class="execute" @click="sendPlan">确定</button>
|
<button class="execute" @click="sendPlan">确定</button>
|
||||||
@@ -79,175 +78,171 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
// 请求
|
// 请求
|
||||||
import { http } from '/nerv-lib/util/http';
|
import { http } from '/nerv-lib/util/http';
|
||||||
import { lightingManage } from '/@/api/IlluminationInfo';
|
import { lightingManage } from '/@/api/IlluminationInfo';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
|
|
||||||
// 初始化 ===========================================================
|
// 初始化 ===========================================================
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// 计划表格
|
// 计划表格
|
||||||
getTable()
|
getTable();
|
||||||
// 穿梭框原始数据
|
// 穿梭框原始数据
|
||||||
getLeftPlan()
|
getLeftPlan();
|
||||||
})
|
});
|
||||||
|
|
||||||
// tab页部分 ========================================================
|
// tab页部分 ========================================================
|
||||||
|
|
||||||
// 表格数据
|
// 表格数据
|
||||||
const dataSource = ref([]);
|
const dataSource = ref([]);
|
||||||
// 获得表格数据
|
// 获得表格数据
|
||||||
const getTable = () => {
|
const getTable = () => {
|
||||||
http.get(lightingManage.getPlanTable, {}).then(res => {
|
http.get(lightingManage.getPlanTable, {}).then((res) => {
|
||||||
dataSource.value = res.data
|
dataSource.value = res.data;
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
// 删除表格中的计划
|
// 删除表格中的计划
|
||||||
const deletePlan = (id: String) => {
|
const deletePlan = (id: String) => {
|
||||||
http.delete(lightingManage.deletePlan, [id]).then(() => {
|
http.delete(lightingManage.deletePlan, [id]).then(() => {
|
||||||
message.success('操作成功')
|
message.success('操作成功');
|
||||||
getTable()
|
getTable();
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
// 重启表格中的计划
|
// 重启表格中的计划
|
||||||
const restartPlan = (id: String) => {
|
const restartPlan = (id: String) => {
|
||||||
http.post(lightingManage.restartPlan, { planId: id }).then(() => {
|
http.post(lightingManage.restartPlan, { planId: id }).then(() => {
|
||||||
message.success('操作成功')
|
message.success('操作成功');
|
||||||
getTable()
|
getTable();
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
// tab页弹窗部分 ====================================================
|
// tab页弹窗部分 ====================================================
|
||||||
|
|
||||||
// 添加弹窗控制变量
|
// 添加弹窗控制变量
|
||||||
const addVisible = ref(false);
|
const addVisible = ref(false);
|
||||||
// 打开弹窗
|
// 打开弹窗
|
||||||
const addModal = () => {
|
const addModal = () => {
|
||||||
addVisible.value = true;
|
addVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 穿梭框部分 =======================================================
|
// 穿梭框部分 =======================================================
|
||||||
|
|
||||||
// 穿梭框数据
|
// 穿梭框数据
|
||||||
const transferData = ref([]) as any;
|
const transferData = ref([]) as any;
|
||||||
// 获得穿梭框原始数据
|
// 获得穿梭框原始数据
|
||||||
const getLeftPlan = () => {
|
const getLeftPlan = () => {
|
||||||
http.get(lightingManage.getLeftPlan, {}).then(res => {
|
http.get(lightingManage.getLeftPlan, {}).then((res) => {
|
||||||
let arr = []
|
let arr = [];
|
||||||
res.data.forEach((item: any) => {
|
res.data.forEach((item: any) => {
|
||||||
arr.push({
|
arr.push({
|
||||||
key: item.id,
|
key: item.id,
|
||||||
title: item.planName
|
title: item.planName,
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
transferData.value = arr
|
transferData.value = arr;
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const handleChange = (keys: string[], direction: string, moveKeys: string[]) => {
|
|
||||||
console.log(keys, direction, moveKeys);
|
|
||||||
};
|
|
||||||
const handleSearch = (dir: string, value: string) => {
|
|
||||||
console.log('search:', dir, value);
|
|
||||||
};
|
|
||||||
// 穿梭框选中数据
|
|
||||||
const targetKeys = ref<string[]>([]);
|
|
||||||
// 将穿梭框选中的计划提交
|
|
||||||
const sendPlan = () => {
|
|
||||||
if (targetKeys.value.length < 1) {
|
|
||||||
return message.info('没有选择任何计划');
|
|
||||||
}
|
|
||||||
http.post(lightingManage.submitLeftPlan, targetKeys.value).then(() => {
|
|
||||||
message.success('添加成功')
|
|
||||||
// 如果发送成功,则刷新表格
|
|
||||||
getTable()
|
|
||||||
getLeftPlan()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const filterOption = (inputValue: string, option: any) => {
|
|
||||||
return option.description.indexOf(inputValue) > -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
const handleChange = (keys: string[], direction: string, moveKeys: string[]) => {
|
||||||
|
console.log(keys, direction, moveKeys);
|
||||||
|
};
|
||||||
|
const handleSearch = (dir: string, value: string) => {
|
||||||
|
console.log('search:', dir, value);
|
||||||
|
};
|
||||||
|
// 穿梭框选中数据
|
||||||
|
const targetKeys = ref<string[]>([]);
|
||||||
|
// 将穿梭框选中的计划提交
|
||||||
|
const sendPlan = () => {
|
||||||
|
if (targetKeys.value.length < 1) {
|
||||||
|
return message.info('没有选择任何计划');
|
||||||
|
}
|
||||||
|
http.post(lightingManage.submitLeftPlan, targetKeys.value).then(() => {
|
||||||
|
message.success('添加成功');
|
||||||
|
// 如果发送成功,则刷新表格
|
||||||
|
getTable();
|
||||||
|
getLeftPlan();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const filterOption = (inputValue: string, option: any) => {
|
||||||
|
return option.description.indexOf(inputValue) > -1;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@import "./dialogStyle.less";
|
@import './dialogStyle.less';
|
||||||
|
|
||||||
// 右下角添加按钮
|
// 右下角添加按钮
|
||||||
.div-add {
|
.div-add {
|
||||||
height: 64px;
|
height: 64px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
.add {
|
.add {
|
||||||
width: 74px;
|
width: 74px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background: rgba(67, 136, 251, 1);
|
background: rgba(67, 136, 251, 1);
|
||||||
border: rgba(67, 136, 251, 1);
|
border: rgba(67, 136, 251, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 表格
|
||||||
|
.custom-table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 416px;
|
||||||
|
height: 60px;
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
}
|
.custom-table th,
|
||||||
// 表格
|
.custom-table td {
|
||||||
.custom-table {
|
border: 1px solid rgba(163, 192, 243, 1);
|
||||||
border-collapse: collapse;
|
text-align: left;
|
||||||
width: 416px;
|
padding: 8px;
|
||||||
height: 60px;
|
text-align: center;
|
||||||
color: rgba(255, 255, 255, 1);
|
|
||||||
}
|
|
||||||
.custom-table th,
|
|
||||||
.custom-table td {
|
|
||||||
border: 1px solid rgba(163, 192, 243, 1);
|
|
||||||
text-align: left;
|
|
||||||
padding: 8px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.table1 {
|
|
||||||
margin-top: 20px;
|
|
||||||
width: 100%;
|
|
||||||
border: 1px solid rgba(255, 255, 255);
|
|
||||||
border-radius: 5px;
|
|
||||||
background: rgba(255, 255, 255, 0.1);
|
|
||||||
// 表格中的操作按钮
|
|
||||||
.tabReboot,
|
|
||||||
.tabDelete {
|
|
||||||
border: none;
|
|
||||||
display: inline-block;
|
|
||||||
background-color: rgba(0, 0, 0, 0);
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 400;
|
|
||||||
letter-spacing: 0;
|
|
||||||
line-height: 20px;
|
|
||||||
color: rgba(67, 136, 251, 1);
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
.tabReboot {
|
.table1 {
|
||||||
margin-right: 8px;
|
margin-top: 20px;
|
||||||
|
width: 100%;
|
||||||
|
border: 1px solid rgba(255, 255, 255);
|
||||||
|
border-radius: 5px;
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
// 表格中的操作按钮
|
||||||
|
.tabReboot,
|
||||||
|
.tabDelete {
|
||||||
|
border: none;
|
||||||
|
display: inline-block;
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 0;
|
||||||
|
line-height: 20px;
|
||||||
|
color: rgba(67, 136, 251, 1);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.tabReboot {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.tabReboot::active {
|
||||||
|
color: white !important;
|
||||||
|
}
|
||||||
|
.tabDelete::active {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.tabReboot::active {
|
::v-deep(.ant-transfer) {
|
||||||
color: white !important;
|
// 屏蔽自带的hover效果
|
||||||
|
.ant-transfer-list-content-item:hover {
|
||||||
|
background: black;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.tabDelete::active {
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
::v-deep(.ant-transfer) {
|
|
||||||
// 屏蔽自带的hover效果
|
|
||||||
.ant-transfer-list-content-item:hover {
|
|
||||||
background: black;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,7 +9,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(row, index) in dataSource1" :key="index" @click="handleRowClick(row.key)"
|
<tr
|
||||||
|
v-for="(row, index) in dataSource1"
|
||||||
|
:key="index"
|
||||||
|
@click="handleRowClick(row.key)"
|
||||||
:class="row.key === trIndex ? 'isTrIndex' : ''">
|
:class="row.key === trIndex ? 'isTrIndex' : ''">
|
||||||
<td>{{ row.key }}</td>
|
<td>{{ row.key }}</td>
|
||||||
<td>{{ row.data }}</td>
|
<td>{{ row.data }}</td>
|
||||||
@@ -19,7 +22,7 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="out-dialog" :class="{ 'showDialog' : logModalVisible }" v-if="logModalVisible">
|
<div class="out-dialog" :class="{ showDialog: logModalVisible }" v-if="logModalVisible">
|
||||||
<div class="content" v-if="logModalVisible">
|
<div class="content" v-if="logModalVisible">
|
||||||
<div>
|
<div>
|
||||||
<div class="div-operation"></div>
|
<div class="div-operation"></div>
|
||||||
@@ -30,7 +33,11 @@
|
|||||||
<div class="imgText">
|
<div class="imgText">
|
||||||
<div class="zjzm">
|
<div class="zjzm">
|
||||||
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />
|
<img class="title-img" src="/asset/image//bulbLogo/21961.png" alt="" />
|
||||||
<span class="title-text" style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)">{{ item.name }}</span>
|
<span
|
||||||
|
class="title-text"
|
||||||
|
style="font-size: 20px; font-weight: 500; color: rgba(255, 255, 255, 1)"
|
||||||
|
>{{ item.name }}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-box">
|
<div class="btn-box">
|
||||||
@@ -43,9 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-item">
|
<div class="btn-item">
|
||||||
<div class="left">
|
<div class="left"> 亮度 </div>
|
||||||
亮度
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<span>100lux</span>
|
<span>100lux</span>
|
||||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||||
@@ -53,9 +58,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-item">
|
<div class="btn-item">
|
||||||
<div class="left">
|
<div class="left"> 控制场景 </div>
|
||||||
控制场景
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<span>手动</span>
|
<span>手动</span>
|
||||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||||
@@ -63,9 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-item">
|
<div class="btn-item">
|
||||||
<div class="left">
|
<div class="left"> 色温 </div>
|
||||||
色温
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<span>4000k</span>
|
<span>4000k</span>
|
||||||
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
<img src="/asset/image/bulbLogo/22406.png" alt="" />
|
||||||
@@ -76,7 +77,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="height: 60px;"></div>
|
<div style="height: 60px"></div>
|
||||||
<div class="button-box">
|
<div class="button-box">
|
||||||
<button class="cancel" @click="logModalVisible = false">取消</button>
|
<button class="cancel" @click="logModalVisible = false">取消</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,169 +88,164 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
|
|
||||||
// 初始化
|
// 初始化
|
||||||
onMounted(() => {
|
onMounted(() => {});
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
// 与父组件的交互 ===================================================================
|
|
||||||
const props = defineProps({
|
|
||||||
// 分区结构(照明区域 > 照明回路)
|
|
||||||
treeData: {
|
|
||||||
type: Array
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const emit = defineEmits(['changeArea']);
|
|
||||||
|
|
||||||
// 表格数据
|
|
||||||
const dataSource1 = ref([
|
|
||||||
{
|
|
||||||
key: '1',
|
|
||||||
data: '2024-05-01',
|
|
||||||
planName: '计划再开',
|
|
||||||
status: '张三111',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '2',
|
|
||||||
data: '2024-05-01',
|
|
||||||
planName: '检修模式',
|
|
||||||
status: '李四12',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: '3',
|
|
||||||
data: '2024-05-01',
|
|
||||||
planName: '设备变更',
|
|
||||||
status: '王五33',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const cxList = ref([
|
|
||||||
{
|
|
||||||
id: '1',
|
|
||||||
name: '站厅照明 1区',
|
|
||||||
manual: '手动',
|
|
||||||
automatic: '自动',
|
|
||||||
brightness: '100lux',
|
|
||||||
brightness2: '30lux',
|
|
||||||
manual2: '手动',
|
|
||||||
automatic2: '自动',
|
|
||||||
brightness3: '4000k',
|
|
||||||
brightness4: '3800k',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '2',
|
|
||||||
name: '站厅照明 2区',
|
|
||||||
manual: '手动',
|
|
||||||
automatic: '自动',
|
|
||||||
brightness: '100lux',
|
|
||||||
brightness2: '30lux',
|
|
||||||
manual2: '手动',
|
|
||||||
automatic2: '自动',
|
|
||||||
brightness3: '4000k',
|
|
||||||
brightness4: '3800k',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: '3',
|
|
||||||
name: '站厅照明 3区',
|
|
||||||
manual: '手动',
|
|
||||||
automatic: '自动',
|
|
||||||
brightness: '100lux',
|
|
||||||
brightness2: '30lux',
|
|
||||||
manual2: '手动',
|
|
||||||
automatic2: '自动',
|
|
||||||
brightness3: '4000k',
|
|
||||||
brightness4: '3800k',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
let trIndex = ref('-1');
|
|
||||||
const logModalVisible = ref(false);
|
|
||||||
const handleRowClick = (index: any) => {
|
|
||||||
trIndex.value = index;
|
|
||||||
if (index === trIndex.value) {
|
|
||||||
console.log('tri');
|
|
||||||
}
|
|
||||||
// 显示模态框
|
|
||||||
logModalVisible.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
// 与父组件的交互 ===================================================================
|
||||||
|
const props = defineProps({
|
||||||
|
// 分区结构(照明区域 > 照明回路)
|
||||||
|
treeData: {
|
||||||
|
type: Array,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const emit = defineEmits(['changeArea']);
|
||||||
|
|
||||||
|
// 表格数据
|
||||||
|
const dataSource1 = ref([
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
data: '2024-05-01',
|
||||||
|
planName: '计划再开',
|
||||||
|
status: '张三111',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2',
|
||||||
|
data: '2024-05-01',
|
||||||
|
planName: '检修模式',
|
||||||
|
status: '李四12',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3',
|
||||||
|
data: '2024-05-01',
|
||||||
|
planName: '设备变更',
|
||||||
|
status: '王五33',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const cxList = ref([
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: '站厅照明 1区',
|
||||||
|
manual: '手动',
|
||||||
|
automatic: '自动',
|
||||||
|
brightness: '100lux',
|
||||||
|
brightness2: '30lux',
|
||||||
|
manual2: '手动',
|
||||||
|
automatic2: '自动',
|
||||||
|
brightness3: '4000k',
|
||||||
|
brightness4: '3800k',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: '站厅照明 2区',
|
||||||
|
manual: '手动',
|
||||||
|
automatic: '自动',
|
||||||
|
brightness: '100lux',
|
||||||
|
brightness2: '30lux',
|
||||||
|
manual2: '手动',
|
||||||
|
automatic2: '自动',
|
||||||
|
brightness3: '4000k',
|
||||||
|
brightness4: '3800k',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: '站厅照明 3区',
|
||||||
|
manual: '手动',
|
||||||
|
automatic: '自动',
|
||||||
|
brightness: '100lux',
|
||||||
|
brightness2: '30lux',
|
||||||
|
manual2: '手动',
|
||||||
|
automatic2: '自动',
|
||||||
|
brightness3: '4000k',
|
||||||
|
brightness4: '3800k',
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
let trIndex = ref('-1');
|
||||||
|
const logModalVisible = ref(false);
|
||||||
|
const handleRowClick = (index: any) => {
|
||||||
|
trIndex.value = index;
|
||||||
|
if (index === trIndex.value) {
|
||||||
|
console.log('tri');
|
||||||
|
}
|
||||||
|
// 显示模态框
|
||||||
|
logModalVisible.value = true;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
@import "./dialogStyle.less";
|
@import './dialogStyle.less';
|
||||||
|
|
||||||
// 右下角添加按钮
|
// 右下角添加按钮
|
||||||
.div-add {
|
.div-add {
|
||||||
height: 64px;
|
height: 64px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
.add {
|
.add {
|
||||||
width: 74px;
|
width: 74px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background: rgba(67, 136, 251, 1);
|
background: rgba(67, 136, 251, 1);
|
||||||
border: rgba(67, 136, 251, 1);
|
border: rgba(67, 136, 251, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表格
|
||||||
|
.custom-table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
width: 416px;
|
||||||
|
height: 60px;
|
||||||
color: rgba(255, 255, 255, 1);
|
color: rgba(255, 255, 255, 1);
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 表格
|
|
||||||
.custom-table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
width: 416px;
|
|
||||||
height: 60px;
|
|
||||||
color: rgba(255, 255, 255, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-table th,
|
|
||||||
.custom-table td {
|
|
||||||
border: 1px solid rgba(163, 192, 243, 1);
|
|
||||||
text-align: left;
|
|
||||||
padding: 8px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table1 {
|
|
||||||
margin-top: 20px;
|
|
||||||
width: 100%;
|
|
||||||
border: 1px solid rgba(255, 255, 255);
|
|
||||||
border-radius: 5px;
|
|
||||||
background: rgba(255, 255, 255, 0.1);
|
|
||||||
|
|
||||||
.tabReboot,
|
|
||||||
.tabDelete {
|
|
||||||
border: none;
|
|
||||||
background-color: rgba(0, 0, 0, 0);
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 400;
|
|
||||||
letter-spacing: 0;
|
|
||||||
line-height: 20px;
|
|
||||||
color: rgba(67, 136, 251, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabReboot {
|
.custom-table th,
|
||||||
margin-right: 8px;
|
.custom-table td {
|
||||||
|
border: 1px solid rgba(163, 192, 243, 1);
|
||||||
|
text-align: left;
|
||||||
|
padding: 8px;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.isTrIndex {
|
.table1 {
|
||||||
background: rgba(67, 136, 251, 1);
|
margin-top: 20px;
|
||||||
}
|
width: 100%;
|
||||||
}
|
border: 1px solid rgba(255, 255, 255);
|
||||||
|
border-radius: 5px;
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
|
||||||
::v-deep(.ant-transfer) {
|
.tabReboot,
|
||||||
|
.tabDelete {
|
||||||
|
border: none;
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 0;
|
||||||
|
line-height: 20px;
|
||||||
|
color: rgba(67, 136, 251, 1);
|
||||||
|
}
|
||||||
|
|
||||||
// 屏蔽自带的hover效果
|
.tabReboot {
|
||||||
.ant-transfer-list-content-item:hover {
|
margin-right: 8px;
|
||||||
background: black;
|
}
|
||||||
|
|
||||||
|
.isTrIndex {
|
||||||
|
background: rgba(67, 136, 251, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep(.ant-transfer) {
|
||||||
|
// 屏蔽自带的hover效果
|
||||||
|
.ant-transfer-list-content-item:hover {
|
||||||
|
background: black;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user