Merge branch 'temp' of http://123.60.103.97:3000/xuziqiang/SaaS-lib into temp
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
export enum equipmentAlarmApi {
|
export enum equipmentAlarmApi {
|
||||||
getTableList = '/carbon-smart/api/AlarmEquipmentLog/selectAlarmEquipmentLog', //设备告警 列表
|
getTableList = '/carbon-smart/api/AlarmEquipmentLog/selectAlarmEquipmentLog', //设备告警 列表
|
||||||
getCodeList = '/carbon-smart/api/AlarmEquipmentLog/selectErrorCodeList', //设备告警 列表
|
getCodeList = '/carbon-smart/api/AlarmEquipmentLog/selectErrorCodeList', //设备告警 列表
|
||||||
|
getSelectAlarmEquipmentLogStatusProcess = '/carbon-smart/api/AlarmEquipmentLogStatusProcess/selectAlarmEquipmentLogStatusProcess', //设备告警 状态 没有创建工单log接口
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,19 +45,9 @@ export const dict = async ({
|
|||||||
export const getAllEnum = async ({
|
export const getAllEnum = async ({
|
||||||
api = `${BASE_URL}/operation/enum/getAllEnum`,
|
api = `${BASE_URL}/operation/enum/getAllEnum`,
|
||||||
params = {},
|
params = {},
|
||||||
keyField = 'dicKey',
|
|
||||||
transform = (res: any) => res,
|
|
||||||
}: dictHttpConfig) => {
|
}: dictHttpConfig) => {
|
||||||
const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object;
|
|
||||||
const key = get(params, keyField) as keyof typeof dictMap;
|
|
||||||
|
|
||||||
if (!dictMap.hasOwnProperty(key)) {
|
|
||||||
const res = await http.post(api, params);
|
const res = await http.post(api, params);
|
||||||
const options = get(transform(res), `data.${key}`);
|
return Promise.resolve(res);
|
||||||
dictMap[key] = options;
|
|
||||||
sessionStorage.setItem('dictMap', JSON.stringify(dictMap));
|
|
||||||
}
|
|
||||||
return Promise.resolve({ data: { data: get(dictMap, key) } });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -67,17 +57,7 @@ export const getAllEnum = async ({
|
|||||||
export const getEnum = async ({
|
export const getEnum = async ({
|
||||||
api = `${BASE_URL}/operation/enum/getEnum`,
|
api = `${BASE_URL}/operation/enum/getEnum`,
|
||||||
params = {},
|
params = {},
|
||||||
keyField = 'dicKey',
|
|
||||||
transform = (res: any) => res,
|
|
||||||
}: dictHttpConfig) => {
|
}: dictHttpConfig) => {
|
||||||
const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object;
|
|
||||||
const key = get(params, keyField) as keyof typeof dictMap;
|
|
||||||
|
|
||||||
if (!dictMap.hasOwnProperty(key)) {
|
|
||||||
const res = await http.post(api, params);
|
const res = await http.post(api, params);
|
||||||
const options = get(transform(res), `data.${key}`);
|
return Promise.resolve(res);
|
||||||
dictMap[key] = options;
|
|
||||||
sessionStorage.setItem('dictMap', JSON.stringify(dictMap));
|
|
||||||
}
|
|
||||||
return Promise.resolve({ data: { data: get(dictMap, key) } });
|
|
||||||
};
|
};
|
||||||
@@ -8,12 +8,12 @@
|
|||||||
<template #description>
|
<template #description>
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-title">
|
<div class="card-title">
|
||||||
<a-tag class="card-title-tag" :color="item.color">{{ item.statusName }}</a-tag>
|
<a-tag class="card-title-tag" :color="item.color">{{ item.stateName }}</a-tag>
|
||||||
<div class="name">{{ item.name }}</div>
|
<div class="name">{{ item.createName }}</div>
|
||||||
<div class="time">{{ item.time }}</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">
|
||||||
{{ item.desc }}</div
|
{{ item.remarks }}</div
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -12,6 +12,20 @@
|
|||||||
<a-form-item name="alarmTitle" label="告警标题">
|
<a-form-item name="alarmTitle" label="告警标题">
|
||||||
<ns-input allowClear v-model:value="infoObject.alarmTitle" placeholder="请输入告警标题" />
|
<ns-input allowClear v-model:value="infoObject.alarmTitle" placeholder="请输入告警标题" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item name="monitorTime" label="监测时长">
|
||||||
|
<ns-input-number
|
||||||
|
allowClear
|
||||||
|
v-model:value="infoObject.monitorTime"
|
||||||
|
placeholder="请输入监测时长" />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="监测时长单位" name="monitorTimeUnit">
|
||||||
|
<a-select
|
||||||
|
v-model:value="infoObject.monitorTimeUnit"
|
||||||
|
placeholder="请选择监测时长单位"
|
||||||
|
style="width: 100%"
|
||||||
|
allowClear
|
||||||
|
:options="monitorTimeUnitData" />
|
||||||
|
</a-form-item>
|
||||||
<a-form-item label="告警频率" name="alarmFrequency">
|
<a-form-item label="告警频率" name="alarmFrequency">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="infoObject.alarmFrequency"
|
v-model:value="infoObject.alarmFrequency"
|
||||||
@@ -35,20 +49,6 @@
|
|||||||
allowClear
|
allowClear
|
||||||
:options="intervalDurationUnitData" />
|
:options="intervalDurationUnitData" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item name="monitorTime" label="监测时长">
|
|
||||||
<ns-input-number
|
|
||||||
allowClear
|
|
||||||
v-model:value="infoObject.monitorTime"
|
|
||||||
placeholder="请输入监测时长" />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="监测时长单位" name="monitorTimeUnit">
|
|
||||||
<a-select
|
|
||||||
v-model:value="infoObject.monitorTimeUnit"
|
|
||||||
placeholder="请选择监测时长单位"
|
|
||||||
style="width: 100%"
|
|
||||||
allowClear
|
|
||||||
:options="monitorTimeUnitData" />
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="优先级" name="priority">
|
<a-form-item label="优先级" name="priority">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="infoObject.priority"
|
v-model:value="infoObject.priority"
|
||||||
@@ -92,6 +92,9 @@
|
|||||||
monitorTimeUnit: null,
|
monitorTimeUnit: null,
|
||||||
priority: null,
|
priority: null,
|
||||||
createWorkOrder: null,
|
createWorkOrder: null,
|
||||||
|
intervalDurationUnit: null,
|
||||||
|
repetitions: null,
|
||||||
|
intervalDuration: null,
|
||||||
enableRules: 0,
|
enableRules: 0,
|
||||||
});
|
});
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
@@ -159,7 +162,15 @@
|
|||||||
} else {
|
} else {
|
||||||
infoObject.value = {
|
infoObject.value = {
|
||||||
id: null,
|
id: null,
|
||||||
accountNo: null,
|
alarmTitle: null,
|
||||||
|
alarmFrequency: null,
|
||||||
|
monitorTime: null,
|
||||||
|
monitorTimeUnit: null,
|
||||||
|
priority: null,
|
||||||
|
createWorkOrder: null,
|
||||||
|
intervalDurationUnit: null,
|
||||||
|
repetitions: null,
|
||||||
|
intervalDuration: null,
|
||||||
enableRules: 0,
|
enableRules: 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -185,10 +196,9 @@
|
|||||||
monitorTime: [
|
monitorTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入正确的监测时长',
|
|
||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
validator: (rules: any, monitorTime: any, cbfn: any) => {
|
validator: (rules: any, monitorTime: any, cbfn: any) => {
|
||||||
if (monitorTime && monitorTime > 0) {
|
if (Number.isInteger(monitorTime) && monitorTime > 0) {
|
||||||
cbfn();
|
cbfn();
|
||||||
} else {
|
} else {
|
||||||
cbfn('请输入正确的监测时长');
|
cbfn('请输入正确的监测时长');
|
||||||
@@ -199,10 +209,9 @@
|
|||||||
intervalDuration: [
|
intervalDuration: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入正确的间隔时长',
|
|
||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
validator: (rules: any, monitorTime: any, cbfn: any) => {
|
validator: (rules: any, intervalDuration: any, cbfn: any) => {
|
||||||
if (monitorTime && monitorTime > 0) {
|
if (Number.isInteger(intervalDuration) && intervalDuration > 0) {
|
||||||
cbfn();
|
cbfn();
|
||||||
} else {
|
} else {
|
||||||
cbfn('请输入正确的间隔时长');
|
cbfn('请输入正确的间隔时长');
|
||||||
@@ -213,10 +222,9 @@
|
|||||||
repetitions: [
|
repetitions: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入正确的重复次数',
|
|
||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
validator: (rules: any, repetitions: any, cbfn: any) => {
|
validator: (rules: any, repetitions: any, cbfn: any) => {
|
||||||
if (repetitions && repetitions > 0) {
|
if (Number.isInteger(repetitions) && repetitions > 0) {
|
||||||
cbfn();
|
cbfn();
|
||||||
} else {
|
} else {
|
||||||
cbfn('请输入正确的重复次数');
|
cbfn('请输入正确的重复次数');
|
||||||
@@ -242,6 +250,50 @@
|
|||||||
const btnClick = () => {
|
const btnClick = () => {
|
||||||
//表单校验
|
//表单校验
|
||||||
formRef.value.validate().then(() => {
|
formRef.value.validate().then(() => {
|
||||||
|
// 告警频率重复时 都换成分钟 比较 监测时长 和 间隔时长 重复次数 * 间隔 <= 监测
|
||||||
|
if (infoObject.value.alarmFrequency === 2) {
|
||||||
|
// 监测时长
|
||||||
|
let monitorTime = 0;
|
||||||
|
switch (infoObject.value.monitorTimeUnit) {
|
||||||
|
case 1:
|
||||||
|
monitorTime = Number(infoObject.value.monitorTime) * 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
monitorTime = Number(infoObject.value.monitorTime) * 60;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
monitorTime = Number(infoObject.value.monitorTime) * 60 * 24;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// 间隔时长
|
||||||
|
let intervalTime = 0;
|
||||||
|
switch (infoObject.value.intervalDurationUnit) {
|
||||||
|
case 1:
|
||||||
|
intervalTime =
|
||||||
|
Number(infoObject.value.intervalDuration) * 1 * Number(infoObject.value.repetitions);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
intervalTime =
|
||||||
|
Number(infoObject.value.intervalDuration) * 60 * Number(infoObject.value.repetitions);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
intervalTime =
|
||||||
|
Number(infoObject.value.intervalDuration) *
|
||||||
|
60 *
|
||||||
|
24 *
|
||||||
|
Number(infoObject.value.repetitions);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (intervalTime > monitorTime) {
|
||||||
|
NsMessage.error(
|
||||||
|
'间隔时长超过了告警监测周期的最大值。请设置1分钟到' +
|
||||||
|
infoObject.value.monitorTime +
|
||||||
|
['分', '小时', '天'][infoObject.value.monitorTimeUnit - 1] +
|
||||||
|
'之间的间隔时长',
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
//调用接口
|
//调用接口
|
||||||
let data = { ...infoObject.value };
|
let data = { ...infoObject.value };
|
||||||
data.createWorkOrder = Number(data.createWorkOrder);
|
data.createWorkOrder = Number(data.createWorkOrder);
|
||||||
|
|||||||
@@ -59,14 +59,14 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'repetitions'">
|
<template v-if="column.dataIndex === 'repetitions'">
|
||||||
{{
|
{{
|
||||||
record.repetitions && record.alarmFrequency.value === 2 ? record.repetitions : ''
|
record.repetitions && record.alarmFrequency.value === 2 ? record.repetitions : '-'
|
||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'interval'">
|
<template v-if="column.dataIndex === 'interval'">
|
||||||
{{
|
{{
|
||||||
record.intervalDuration && record.alarmFrequency.value === 2
|
record.intervalDuration && record.alarmFrequency.value === 2
|
||||||
? record.intervalDuration + '' + record.intervalDurationUnit.label
|
? record.intervalDuration + '' + record.intervalDurationUnit.label
|
||||||
: ''
|
: '-'
|
||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -112,14 +112,14 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'repetitions'">
|
<template v-if="column.dataIndex === 'repetitions'">
|
||||||
{{
|
{{
|
||||||
record.repetitions && record.alarmFrequency.value === 2 ? record.repetitions : ''
|
record.repetitions && record.alarmFrequency.value === 2 ? record.repetitions : '-'
|
||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'interval'">
|
<template v-if="column.dataIndex === 'interval'">
|
||||||
{{
|
{{
|
||||||
record.intervalDuration && record.alarmFrequency.value === 2
|
record.intervalDuration && record.alarmFrequency.value === 2
|
||||||
? record.intervalDuration + '' + record.intervalDurationUnit.label
|
? record.intervalDuration + '' + record.intervalDurationUnit.label
|
||||||
: ''
|
: '-'
|
||||||
}}
|
}}
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -12,22 +12,22 @@
|
|||||||
<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" :rules="rules">
|
<a-form ref="formRef" :model="infoObject" :rules="rules">
|
||||||
<a-form-item ref="status" label="当前状态" name="status">
|
<a-form-item ref="state" label="当前状态" createName="state">
|
||||||
<a-select
|
<a-select
|
||||||
v-model:value="infoObject.status"
|
v-model:value="infoObject.state"
|
||||||
show-search
|
show-search
|
||||||
placeholder="请选择设备点位"
|
placeholder="请选择设备点位"
|
||||||
style="width: 85%"
|
style="width: 85%"
|
||||||
:options="statusOptions"
|
:options="stateOptions"
|
||||||
:disabled="showEdit"
|
:disabled="showEdit"
|
||||||
:filter-option="filterDevicePoint" />
|
:filter-option="filterDevicePoint" />
|
||||||
<ns-icon
|
<ns-icon
|
||||||
size="20"
|
size="20"
|
||||||
@click="() => (showEdit = !showEdit)"
|
@click="changeShowEdit"
|
||||||
style="margin-left: 20px"
|
style="margin-left: 20px"
|
||||||
:name="showEdit ? 'bianji' : 'baocun'" />
|
:createName="showEdit ? 'bianji' : 'baocun'" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="备注" name="desc">
|
<a-form-item label="备注" createName="desc">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
v-model:value="infoObject.desc"
|
v-model:value="infoObject.desc"
|
||||||
placeholder="请输入异常描述"
|
placeholder="请输入异常描述"
|
||||||
@@ -55,6 +55,8 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import NsSteps from '/@/components/ns-steps.vue';
|
import NsSteps from '/@/components/ns-steps.vue';
|
||||||
import { NsMessage } from '/nerv-lib/component';
|
import { NsMessage } from '/nerv-lib/component';
|
||||||
|
import { http } from '/nerv-lib/util';
|
||||||
|
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { NsSteps },
|
components: { NsSteps },
|
||||||
@@ -64,33 +66,46 @@
|
|||||||
const showEdit = ref(true);
|
const showEdit = ref(true);
|
||||||
const infoObject = ref({});
|
const infoObject = ref({});
|
||||||
const equipmentAlarm = ref({});
|
const equipmentAlarm = ref({});
|
||||||
const statusOptions = ref();
|
const stateOptions = ref();
|
||||||
const logList = ref([
|
const logList = ref([
|
||||||
{ name: '李四', status: 3, time: '2024-03-10 10:00:00', desc: '完成' },
|
{ createName: '李四', state: 3, createTime: '2024-03-10 10:00:00', desc: '完成' },
|
||||||
{ name: '王五', status: 5, time: '2024-03-10 10:00:00' },
|
{ createName: '王五', state: 5, createTime: '2024-03-10 10:00:00' },
|
||||||
{ name: '王五', status: 4, time: '2024-03-10 10:00:00' },
|
{ createName: '王五', state: 4, createTime: '2024-03-10 10:00:00' },
|
||||||
{ name: '王五', status: 2, time: '2024-03-10 10:00:00', desc: '创建工单' },
|
{ createName: '王五', state: 2, createTime: '2024-03-10 10:00:00', desc: '创建工单' },
|
||||||
{ name: '赵六', status: 1, time: '2024-03-10 10:00:00' },
|
{ createName: '赵六', state: 1, createTime: '2024-03-10 10:00:00' },
|
||||||
]);
|
]);
|
||||||
const config = ref({
|
const config = ref({
|
||||||
size: logList.value.length,
|
size: logList.value.length,
|
||||||
dataSource: logList.value,
|
dataSource: logList.value,
|
||||||
});
|
});
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
|
equipmentAlarm.value = P;
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
};
|
};
|
||||||
const btnClick = () => {
|
const btnClick = () => {
|
||||||
NsMessage.success('操作成功');
|
NsMessage.success('操作成功');
|
||||||
delete infoObject.value.time;
|
delete infoObject.value.createTime;
|
||||||
console.log(infoObject.value, equipmentAlarm.value, '操作');
|
console.log(infoObject.value, equipmentAlarm.value, '操作');
|
||||||
console.log('btnClick');
|
console.log('btnClick');
|
||||||
};
|
};
|
||||||
const toggle = (data) => {
|
//修改状态
|
||||||
console.log(data, '数据');
|
const changeShowEdit = () => {
|
||||||
equipmentAlarm.value = data;
|
|
||||||
infoObject.value = { ...logList.value[0] };
|
|
||||||
if (equipmentAlarm.value.createWorkOrder === 1) {
|
if (equipmentAlarm.value.createWorkOrder === 1) {
|
||||||
statusOptions.value = [
|
showEdit.value = !showEdit.value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const toggle = async (data) => {
|
||||||
|
equipmentAlarm.value = { ...data };
|
||||||
|
infoObject.value = { ...logList.value[0] };
|
||||||
|
await http
|
||||||
|
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
|
||||||
|
id: data.id,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
});
|
||||||
|
if (equipmentAlarm.value.createWorkOrder === 1) {
|
||||||
|
stateOptions.value = [
|
||||||
{ value: 1, label: '待处理' },
|
{ value: 1, label: '待处理' },
|
||||||
{ value: 2, label: '处理中' },
|
{ value: 2, label: '处理中' },
|
||||||
{ value: 3, label: '已完成' },
|
{ value: 3, label: '已完成' },
|
||||||
@@ -98,7 +113,7 @@
|
|||||||
{ value: 5, label: '已关闭' },
|
{ value: 5, label: '已关闭' },
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
statusOptions.value = [
|
stateOptions.value = [
|
||||||
{ value: 1, label: '待处理' },
|
{ value: 1, label: '待处理' },
|
||||||
{ value: 2, label: '处理中' },
|
{ value: 2, label: '处理中' },
|
||||||
{ value: 3, label: '已完成' },
|
{ value: 3, label: '已完成' },
|
||||||
@@ -120,17 +135,18 @@
|
|||||||
5: '#a6a6a6',
|
5: '#a6a6a6',
|
||||||
};
|
};
|
||||||
logList.value.forEach((item) => {
|
logList.value.forEach((item) => {
|
||||||
item.statusName = statusMap[item.status];
|
item.stateName = statusMap[item.state];
|
||||||
item.color = colorMap[item.status];
|
item.color = colorMap[item.state];
|
||||||
item.src = 'status-' + item.status;
|
item.src = 'state-' + item.state;
|
||||||
});
|
});
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
infoObject,
|
infoObject,
|
||||||
|
changeShowEdit,
|
||||||
showEdit,
|
showEdit,
|
||||||
equipmentAlarm,
|
equipmentAlarm,
|
||||||
statusOptions,
|
stateOptions,
|
||||||
btnClick,
|
btnClick,
|
||||||
visible,
|
visible,
|
||||||
logList,
|
logList,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ const tableKeyMap = [
|
|||||||
{
|
{
|
||||||
title: '序号',
|
title: '序号',
|
||||||
dataIndex: 'address',
|
dataIndex: 'address',
|
||||||
|
width: 80,
|
||||||
customRender: (text: any) => {
|
customRender: (text: any) => {
|
||||||
return text.index + 1;
|
return text.index + 1;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -739,27 +739,27 @@
|
|||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
label: 'CO2',
|
label: 'CO2',
|
||||||
value: 'CO2',
|
value: '1',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'CO2e',
|
label: 'CO2e',
|
||||||
value: 'CO2e',
|
value: '2',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'SF6',
|
label: 'SF6',
|
||||||
value:'SF6',
|
value:'3',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'CH4',
|
label: 'CH4',
|
||||||
value: 'CH4',
|
value: '4',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'PFCs',
|
label: 'PFCs',
|
||||||
value: 'PFCs',
|
value: '5',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'HFCs',
|
label: 'HFCs',
|
||||||
value: 'HFCs',
|
value: '6',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -291,10 +291,10 @@
|
|||||||
// };
|
// };
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
::v-deep .ant-table-title{
|
:deep(.ant-table-title){
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
::v-deep .ant-table-container{
|
:deep(.ant-table-container){
|
||||||
padding: 0px 16px;
|
padding: 0px 16px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -177,10 +177,10 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
::v-deep .ant-table-title{
|
:deep(.ant-table-title){
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
::v-deep .ant-table-container{
|
:deep(.ant-table-container){
|
||||||
padding: 0px 16px;
|
padding: 0px 16px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -576,10 +576,10 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
::v-deep .ant-table-title{
|
:deep(.ant-table-title) {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
::v-deep .ant-table-container{
|
:deep(.ant-table-container) {
|
||||||
padding: 0px 16px;
|
padding: 0px 16px;
|
||||||
}
|
}
|
||||||
.buttonGroup{
|
.buttonGroup{
|
||||||
|
|||||||
@@ -490,7 +490,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
::v-deep .ant-table-container{
|
:deep(.ant-table-container) {
|
||||||
padding: 0px 16px;
|
padding: 0px 16px;
|
||||||
}
|
}
|
||||||
:deep(.ns-table-main) {
|
:deep(.ns-table-main) {
|
||||||
@@ -527,7 +527,7 @@
|
|||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
background-color: #2778FF;
|
background-color: #2778FF;
|
||||||
}
|
}
|
||||||
::v-deep .ant-table-title{
|
:deep(.ant-table-title) {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -1,283 +1,97 @@
|
|||||||
import { ref } from 'vue';
|
// 填报页表头
|
||||||
import { http } from '/nerv-lib/util';
|
export const columns = [
|
||||||
import { origanizemanage } from '/@/api/origanizemanage';
|
|
||||||
import { carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
|
||||||
export const formConfig = (disabled) => {
|
|
||||||
return ref([
|
|
||||||
{
|
{
|
||||||
field: 'fields',
|
title: '日期',
|
||||||
component: 'NsChildForm',
|
dataIndex: 'name',
|
||||||
componentProps: {
|
key: 'name',
|
||||||
schemas: [
|
width: 100,
|
||||||
{
|
fixed: 'left',
|
||||||
label: '排放源',
|
|
||||||
field: 'emissionSources',
|
|
||||||
component: 'NsInput',
|
|
||||||
componentProps: {
|
|
||||||
placeholder: '请输入排放源',
|
|
||||||
maxLength: 20,
|
|
||||||
},
|
},
|
||||||
rules: [
|
|
||||||
{
|
{
|
||||||
required: true,
|
title: '消耗量',
|
||||||
message: '请输入排放源',
|
children: [
|
||||||
|
{
|
||||||
|
title: '数据来源',
|
||||||
|
dataIndex: 'companyAddress',
|
||||||
|
key: 'companyAddress',
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数值',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
key: 'companyName',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'emissionType',
|
title: '碳排因子',
|
||||||
label: '排放分类',
|
children: [
|
||||||
component: 'NsCascader',
|
|
||||||
fieldMap: ['emissionType'],
|
|
||||||
componentProps: {
|
|
||||||
placeholder: '请选择排放分类',
|
|
||||||
api: carbonEmissionFactorLibrary.getCarbonFactorTree,
|
|
||||||
fieldNames: { label: 'emissionName', value: 'id' },
|
|
||||||
showSearch: true,
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
{
|
{
|
||||||
required: true,
|
title: '数据来源',
|
||||||
message: '请选择排放分类',
|
dataIndex: 'companyAddress',
|
||||||
|
key: 'companyAddress',
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数值',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
key: 'companyName',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'emissionGas',
|
title: '排放量',
|
||||||
label: '排放气体',
|
dataIndex: 'gender',
|
||||||
component: 'NsSelect',
|
key: 'gender',
|
||||||
componentProps: {
|
width: 80,
|
||||||
allowClear: true,
|
fixed: 'right',
|
||||||
placeholder: '请选择排放气体',
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: 'CO2',
|
|
||||||
value: 'CO2',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'CO2e',
|
title: '操作',
|
||||||
value: 'CO2e',
|
dataIndex: 'action',
|
||||||
|
key: 'action',
|
||||||
|
width: 80,
|
||||||
|
fixed: 'right',
|
||||||
},
|
},
|
||||||
|
];
|
||||||
|
// 凭证弹窗表头
|
||||||
|
export const voucherColumns = [
|
||||||
{
|
{
|
||||||
label: 'SF6',
|
title: '序号',
|
||||||
value:'SF6',
|
customRender: (text: any) => {
|
||||||
},
|
return text.index + 1;
|
||||||
{
|
|
||||||
label: 'CH4',
|
|
||||||
value: 'CH4',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'PFCs',
|
|
||||||
value: 'PFCs',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'HFCs',
|
|
||||||
value: 'HFCs',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请选择排放气体',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// field: 'emissionProcess',
|
|
||||||
// label: '排放环节',
|
|
||||||
// component: 'NsSelectApi',
|
|
||||||
// componentProps: {
|
|
||||||
// api: carbonEmissionFactorLibrary.getEmissionProcess,
|
|
||||||
// params: {
|
|
||||||
// emissionType: sessionStorage.getItem('checkedTreeNode'),
|
|
||||||
// },
|
|
||||||
// resultField: 'data',
|
|
||||||
// labelField: 'emissionProcess',
|
|
||||||
// valueField: 'emissionProcess',
|
|
||||||
// immediate: true,
|
|
||||||
// autoSelectFirst: false,
|
|
||||||
// filterOption:false,
|
|
||||||
// showSearch:true,
|
|
||||||
// autoClearSearchValue:false
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
label: '排放环节',
|
|
||||||
field: 'emissionProcess',
|
|
||||||
component: 'NsInput',
|
|
||||||
componentProps: {
|
|
||||||
placeholder: '请输入排放环节',
|
|
||||||
maxLength: 20,
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入排放环节',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '排放因子',
|
|
||||||
field: 'emissionFactors',
|
|
||||||
component: 'NsInputNumber',
|
|
||||||
componentProps: {
|
|
||||||
placeholder: '请输入排放因子值',
|
|
||||||
maxLength: 20,
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入排放因子值',
|
|
||||||
trigger: 'change',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'carbonEmissionPrefix',
|
|
||||||
label: '碳排前缀',
|
|
||||||
component: 'NsSelect',
|
|
||||||
componentProps: {
|
|
||||||
disabled: true,
|
|
||||||
allowClear: true,
|
|
||||||
defaultValue: 't',
|
|
||||||
placeholder: '请选择碳排前缀',
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: 'g',
|
|
||||||
value: 'g',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'kg',
|
|
||||||
value: 'kg',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 't',
|
|
||||||
value: 't',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请选择碳排前缀',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '碳排后缀',
|
|
||||||
field: 'carbonEmissionSuffix',
|
|
||||||
component: 'NsInput',
|
|
||||||
componentProps: {
|
|
||||||
placeholder: '请输入碳排后缀',
|
|
||||||
maxLength: 20,
|
|
||||||
},
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '请输入碳排后缀',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '已引用数',
|
|
||||||
field: 'numberOfReferences',
|
|
||||||
component: 'NsInput',
|
|
||||||
componentProps: {
|
|
||||||
defaultValue: 10,
|
|
||||||
disabled: true,
|
|
||||||
maxLength: 20,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '参考文献',
|
title: '日期',
|
||||||
field: 'reference',
|
dataIndex: 'age',
|
||||||
component: 'NsTextarea',
|
key: 'age',
|
||||||
componentProps: {
|
|
||||||
placeholder: '请输入参考文献',
|
|
||||||
maxLength: 20,
|
|
||||||
},
|
},
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
const options = ref([]);
|
|
||||||
|
|
||||||
const getUserPerList = (transform, params = {}) => {
|
|
||||||
return http.post(origanizemanage.queryUserPerList, { ...params }).then((res) => {
|
|
||||||
return res.data?.map((item) => {
|
|
||||||
item = { ...item, ...transform(item) };
|
|
||||||
return item;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
export const formConfig2 = (casData: any) => {
|
|
||||||
return ref([
|
|
||||||
{
|
{
|
||||||
field: 'information',
|
title: '文件名称',
|
||||||
component: 'NsCascader',
|
dataIndex: 'address',
|
||||||
componentProps: {
|
key: 'address 1',
|
||||||
placeholder: '请选择',
|
ellipsis: true,
|
||||||
displayRender: ({ labels, selectedOptions }: any) => {
|
|
||||||
console.log(labels, selectedOptions);
|
|
||||||
|
|
||||||
casData.value = selectedOptions.map(({ label, value }) => {
|
|
||||||
return { label, value };
|
|
||||||
});
|
|
||||||
return labels.join('/');
|
|
||||||
},
|
},
|
||||||
loadData: (selectedOptions, options) => {
|
];
|
||||||
console.log(selectedOptions, options, 'selectedOptions, options');
|
// 编辑页中表头
|
||||||
|
export const drawerColumns = [
|
||||||
const targetOption = selectedOptions[selectedOptions.length - 1];
|
{
|
||||||
let transForm, params;
|
title: '名称',
|
||||||
// load options lazily
|
dataIndex: 'emissionSources',
|
||||||
if (!selectedOptions.length) {
|
|
||||||
transForm = (data) => {
|
|
||||||
data['label'] = data.orgName;
|
|
||||||
data['value'] = data.orgId;
|
|
||||||
data['isLeaf'] = false;
|
|
||||||
data['level'] = 1;
|
|
||||||
return data;
|
|
||||||
};
|
|
||||||
getUserPerList(transForm).then((res) => {
|
|
||||||
options.value = [...res];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const id = targetOption?.value;
|
|
||||||
const level = targetOption?.level;
|
|
||||||
if (targetOption) {
|
|
||||||
targetOption.loading = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (level === 1) {
|
|
||||||
transForm = (data) => {
|
|
||||||
data['label'] = data.deptName;
|
|
||||||
data['value'] = data.deptId;
|
|
||||||
data['isLeaf'] = false;
|
|
||||||
data['level'] = 2;
|
|
||||||
return data;
|
|
||||||
};
|
|
||||||
params = { orgId: id };
|
|
||||||
} else if (level === 2) {
|
|
||||||
transForm = (data) => {
|
|
||||||
data['label'] = data.roleName;
|
|
||||||
data['value'] = data.roleId;
|
|
||||||
data['level'] = 3;
|
|
||||||
return data;
|
|
||||||
};
|
|
||||||
params = { deptId: id };
|
|
||||||
}
|
|
||||||
if (targetOption) {
|
|
||||||
getUserPerList(transForm, { ...params }).then((res) => {
|
|
||||||
targetOption.loading = false;
|
|
||||||
targetOption.children = [...res];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '因子值',
|
||||||
|
dataIndex: 'emissionFactors',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '排放环节',
|
||||||
|
className: 'emissionProcess',
|
||||||
|
dataIndex: 'emissionProcess',
|
||||||
},
|
},
|
||||||
]);
|
{
|
||||||
};
|
title: '数据来源',
|
||||||
|
className: 'dataSources',
|
||||||
|
dataIndex: 'dataSources',
|
||||||
|
},
|
||||||
|
];
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -61,8 +61,8 @@
|
|||||||
return http.post(api, params);
|
return http.post(api, params);
|
||||||
};
|
};
|
||||||
// 判断展示哪个页面
|
// 判断展示哪个页面
|
||||||
const isMainPage = ref(true);
|
const isMainPage = ref(false);
|
||||||
const fillInPage = ref(false);
|
const fillInPage = ref(true);
|
||||||
// 新增相关数据
|
// 新增相关数据
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const formState = ref({})
|
const formState = ref({})
|
||||||
|
|||||||
@@ -49,7 +49,12 @@
|
|||||||
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
|
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
|
||||||
<a-tabs v-model:activeKey="activeKey">
|
<a-tabs v-model:activeKey="activeKey">
|
||||||
<a-tab-pane key="1" tab="控制面板">
|
<a-tab-pane key="1" tab="控制面板">
|
||||||
<tabs1 @changeArea="changeArea" @reset="reset" :treeData="treeData" :nowArea="nowArea"></tabs1>
|
<tabs1
|
||||||
|
@changeArea="changeArea"
|
||||||
|
@reset="reset"
|
||||||
|
:treeData="treeData"
|
||||||
|
:nowArea="nowArea"
|
||||||
|
></tabs1>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="2" tab="计划列表" force-render>
|
<a-tab-pane key="2" tab="计划列表" force-render>
|
||||||
<tabs2></tabs2>
|
<tabs2></tabs2>
|
||||||
@@ -83,6 +88,7 @@ import {
|
|||||||
// 初始化 =======================================================
|
// 初始化 =======================================================
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 获得分区与线路的结构
|
||||||
http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then(res => {
|
http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then(res => {
|
||||||
const data = res.data
|
const data = res.data
|
||||||
floorData.value = data
|
floorData.value = data
|
||||||
|
|||||||
@@ -81,9 +81,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 控制模式按钮部分 -->
|
<!-- 控制模式按钮部分 -->
|
||||||
<div class="control-mode-btn-area" v-show="showControlMode">
|
<div class="control-mode-btn-area" v-show="showControlMode">
|
||||||
<button v-for="(button3, index) in controlType" :key="index"
|
<button v-for="(button3, index) in controlMode" :key="index"
|
||||||
:class="{ btn: true, selected: button3.type == thisButton.type }" @click="selectButton3(button3)">
|
class="btn"
|
||||||
{{ button3.name }}
|
:class="{ selected: thisButton.mode.value == button3.value }" @click="selectButton3(button3)">
|
||||||
|
{{ button3.label }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -212,7 +213,6 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, onMounted, watch } from 'vue';
|
import { ref, computed, onMounted, watch } from 'vue';
|
||||||
import { controlType } from './treeData'
|
|
||||||
import {
|
import {
|
||||||
DownOutlined,
|
DownOutlined,
|
||||||
UpOutlined,
|
UpOutlined,
|
||||||
@@ -222,11 +222,15 @@ import { message } from 'ant-design-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 { getAllEnum } from '/@/api/index'
|
||||||
|
|
||||||
// 初始化 =========================================================================
|
// 初始化 =========================================================================
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 设置分区
|
||||||
setArea()
|
setArea()
|
||||||
|
// 获得枚举
|
||||||
|
getEnum(['IlluminationMode', 'IlluminationScene'])
|
||||||
})
|
})
|
||||||
// 父组件点击俯视图切换分区时,子组件切换线路
|
// 父组件点击俯视图切换分区时,子组件切换线路
|
||||||
const setArea = () => {
|
const setArea = () => {
|
||||||
@@ -402,8 +406,13 @@ const toggleSelection = (button: any) => {
|
|||||||
} else {
|
} else {
|
||||||
// 未发生选中 或 多选被取消
|
// 未发生选中 或 多选被取消
|
||||||
showControlMode.value = false
|
showControlMode.value = false
|
||||||
thisButton.value = { type: '0' }
|
thisButton.value = {
|
||||||
|
mode: {
|
||||||
|
value: '0'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log(thisButton,'button')
|
||||||
};
|
};
|
||||||
|
|
||||||
// 照明回路所有按钮
|
// 照明回路所有按钮
|
||||||
@@ -417,16 +426,31 @@ const limitedButtons2 = computed(() => buttons2.value.slice(0, 8));
|
|||||||
|
|
||||||
// 决定该区域是否显示
|
// 决定该区域是否显示
|
||||||
const showControlMode = ref(false);
|
const showControlMode = ref(false);
|
||||||
const thisButton = ref({ type: 0 })
|
const thisButton = ref({
|
||||||
|
mode: {
|
||||||
|
value: '0'
|
||||||
|
}
|
||||||
|
})
|
||||||
// 控制模式 - 按钮切换
|
// 控制模式 - 按钮切换
|
||||||
const selectButton3 = (button3) => {
|
const selectButton3 = (button3) => {
|
||||||
thisButton.value.type = button3.type
|
let checked = thisButton.value.mode.value
|
||||||
showControlScene.value = button3.name === '手动';
|
console.log(button3.value,'---', checked)
|
||||||
|
// 如果点击了相同的按钮,未作出修改
|
||||||
|
if (checked === button3.value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
checked = button3.value
|
||||||
|
// 如果当前选项是手动模式
|
||||||
|
showControlScene.value = button3.label === '手动模式';
|
||||||
selectedButton4.value = null; // 清空选中的控制场景按钮
|
selectedButton4.value = null; // 清空选中的控制场景按钮
|
||||||
};
|
};
|
||||||
|
|
||||||
// 控制场景业务 =====================================================================
|
// 控制场景业务 =====================================================================
|
||||||
|
|
||||||
|
// 控制模式枚举
|
||||||
|
const controlMode = ref([])
|
||||||
|
// 场景枚举
|
||||||
|
const controlScene = ref([])
|
||||||
// 决定该区域是否显示
|
// 决定该区域是否显示
|
||||||
const showControlScene = ref(false);
|
const showControlScene = ref(false);
|
||||||
// 控制场景 - 所有按钮
|
// 控制场景 - 所有按钮
|
||||||
@@ -458,6 +482,8 @@ const handleRowClick = (index: any) => {
|
|||||||
|
|
||||||
// 内侧弹窗 ========================================================================
|
// 内侧弹窗 ========================================================================
|
||||||
|
|
||||||
|
// 需要向后端提交的修改内容
|
||||||
|
const submitArray = ref([])
|
||||||
const cxList = ref([
|
const cxList = ref([
|
||||||
{
|
{
|
||||||
id: '1',
|
id: '1',
|
||||||
@@ -498,7 +524,7 @@ const cxList = ref([
|
|||||||
]);
|
]);
|
||||||
//撤销
|
//撤销
|
||||||
const delBtn = (id: any) => {
|
const delBtn = (id: any) => {
|
||||||
cxList.value.pop(id);
|
cxList.value.pop();
|
||||||
console.log(cxList.value.length);
|
console.log(cxList.value.length);
|
||||||
|
|
||||||
if (cxList.value.length === 0) {
|
if (cxList.value.length === 0) {
|
||||||
@@ -514,14 +540,6 @@ const isLoading = ref(false)
|
|||||||
const initMenu = (tier: number) => {
|
const initMenu = (tier: number) => {
|
||||||
// 1 = 照明区域 - 切换时,重置以下所有菜单
|
// 1 = 照明区域 - 切换时,重置以下所有菜单
|
||||||
if (tier == 1) {
|
if (tier == 1) {
|
||||||
// 切换前,清除照明回路的选中状态
|
|
||||||
// buttons2.value.forEach(item => {
|
|
||||||
// item.selected = false
|
|
||||||
// })
|
|
||||||
// // 切换后,清空所有选中状态
|
|
||||||
// props.treeData.forEach(item => {
|
|
||||||
// item.selected = false
|
|
||||||
// })
|
|
||||||
emit('reset')
|
emit('reset')
|
||||||
// 控制模式 隐藏
|
// 控制模式 隐藏
|
||||||
showControlMode.value = false;
|
showControlMode.value = false;
|
||||||
@@ -568,6 +586,15 @@ const changeConfirm = () => {
|
|||||||
const changeCancel = () => {
|
const changeCancel = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// 获得枚举,初始化
|
||||||
|
const getEnum = (arr: any) => {
|
||||||
|
getAllEnum({ params: arr }).then(res => {
|
||||||
|
const data = res.data
|
||||||
|
controlMode.value = data.IlluminationMode
|
||||||
|
controlScene.value = data.IlluminationScene
|
||||||
|
})
|
||||||
|
console.log(controlMode, controlScene, '001')
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
@@ -41,7 +41,14 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="tabReboot" @click="restartPlan(row.id)">重启</div>
|
<div class="tabReboot" @click="restartPlan(row.id)">重启</div>
|
||||||
<div class="tabDelete" @click="deletePlan(row.id)">删除</div>
|
<a-popconfirm
|
||||||
|
title="此操作将永久删除该条数据"
|
||||||
|
ok-text="确定"
|
||||||
|
cancel-text="取消"
|
||||||
|
@confirm="deletePlan(row.id)"
|
||||||
|
>
|
||||||
|
<div class="tabDelete">删除</div>
|
||||||
|
</a-popconfirm>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -121,6 +128,7 @@ const addModal = () => {
|
|||||||
addVisible.value = true;
|
addVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 穿梭框部分 =======================================================
|
// 穿梭框部分 =======================================================
|
||||||
|
|
||||||
// 穿梭框数据
|
// 穿梭框数据
|
||||||
|
|||||||
Reference in New Issue
Block a user